mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Replace function by another one
Replace QETApp::diagramInfoKeys() by QETInformation::diagramInfoKeys() and QETApp::diagramTranslatedInfoKey(str) by QETInformation::translatedInfoKey(str)
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "element.h"
|
||||
#include "diagram.h"
|
||||
#include "diagramposition.h"
|
||||
#include "qetinformation.h"
|
||||
|
||||
#include <QSqlError>
|
||||
#include <QLocale>
|
||||
@@ -268,7 +269,7 @@ bool projectDataBase::createDataBase()
|
||||
//Create the diagram info table
|
||||
QString diagram_info_table("CREATE TABLE diagram_info (diagram_uuid VARCHAR(50) PRIMARY KEY NOT NULL, ");
|
||||
first_ = true;
|
||||
for (auto string : QETApp::diagramInfoKeys())
|
||||
for (auto string : QETInformation::diagramInfoKeys())
|
||||
{
|
||||
if (first_) {
|
||||
first_ = false;
|
||||
@@ -471,11 +472,11 @@ void projectDataBase::prepareQuery()
|
||||
//INSERT DIAGRAM INFO
|
||||
m_insert_diagram_info_query = QSqlQuery(m_data_base);
|
||||
QStringList bind_diag_info_values;
|
||||
for (auto key : QETApp::diagramInfoKeys()) {
|
||||
for (auto key : QETInformation::diagramInfoKeys()) {
|
||||
bind_diag_info_values << key.prepend(":");
|
||||
}
|
||||
QString insert_diag_info("INSERT INTO diagram_info (diagram_uuid, " +
|
||||
QETApp::diagramInfoKeys().join(", ") +
|
||||
QETInformation::diagramInfoKeys().join(", ") +
|
||||
") VALUES (:uuid, " +
|
||||
bind_diag_info_values.join(", ") +
|
||||
")");
|
||||
@@ -483,7 +484,7 @@ void projectDataBase::prepareQuery()
|
||||
|
||||
//UPDATE DIAGRAM INFO
|
||||
QString update_diagram_str("UPDATE diagram_info SET ");
|
||||
for (auto str : QETApp::diagramInfoKeys()) {
|
||||
for (auto str : QETInformation::diagramInfoKeys()) {
|
||||
update_diagram_str.append(str + " = :" + str + ", ");
|
||||
}
|
||||
update_diagram_str.remove(update_diagram_str.length()-2, 2); //Remove the last ", "
|
||||
@@ -558,7 +559,7 @@ void projectDataBase::bindDiagramInfoValues(QSqlQuery &query, Diagram *diagram)
|
||||
query.bindValue(":uuid", diagram->uuid());
|
||||
|
||||
auto infos = diagram->border_and_titleblock.titleblockInformation();
|
||||
for (auto key : QETApp::diagramInfoKeys())
|
||||
for (auto key : QETInformation::diagramInfoKeys())
|
||||
{
|
||||
if (key == "date") {
|
||||
query.bindValue( ":date",
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "summaryquerywidget.h"
|
||||
#include "ui_summaryquerywidget.h"
|
||||
#include "qetapp.h"
|
||||
#include "qetinformation.h"
|
||||
|
||||
#include <QListWidgetItem>
|
||||
|
||||
@@ -121,12 +122,12 @@ void SummaryQueryWidget::setQuery(const QString &query)
|
||||
*/
|
||||
void SummaryQueryWidget::setUpItems()
|
||||
{
|
||||
for (auto key : QETApp::diagramInfoKeys())
|
||||
for (auto key : QETInformation::diagramInfoKeys())
|
||||
{
|
||||
if (key == "filename" || key == "display_folio") {
|
||||
continue;
|
||||
}
|
||||
auto item = new QListWidgetItem(QETApp::diagramTranslatedInfoKey(key), ui->m_available_list);
|
||||
auto item = new QListWidgetItem(QETInformation::translatedInfoKey(key), ui->m_available_list);
|
||||
item->setData(Qt::UserRole, key);
|
||||
m_items_list << item;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user