[qet] qet/qet: [4911] Improve autonumbering to assign formulas to custom element label. |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 4911
Author: scorpio810
Date: 2017-02-13 20:26:09 +0100 (Mon, 13 Feb 2017)
Log Message:
-----------
Improve autonumbering to assign formulas to custom element label.
Modified Paths:
--------------
trunk/sources/autoNum/assignvariables.cpp
Modified: trunk/sources/autoNum/assignvariables.cpp
===================================================================
--- trunk/sources/autoNum/assignvariables.cpp 2017-02-13 11:43:04 UTC (rev 4910)
+++ trunk/sources/autoNum/assignvariables.cpp 2017-02-13 19:26:09 UTC (rev 4911)
@@ -462,14 +462,6 @@
}
// Only Electric labels created so far
- //if (current_location.fileName() != "10_electric")
- QString qet_labels = "10_electric/qet_labels.xml";
- QString filepath = QETApp::commonElementsDir().append(qet_labels);
- QFile file(filepath);
- file.isReadable();
- if (!file.open(QFile::ReadOnly | QFile::Text))
- return QString();
-
if (current_location.fileName() != "10_electric"){
QString custom_labels = "qet_labels.xml";
QString customfilepath = QETApp::customElementsDir().append(custom_labels);
@@ -477,10 +469,23 @@
file.isReadable();
if (!file.open(QFile::ReadOnly | QFile::Text))
return QString();
+
+ rxml.setDevice(&file);
+ rxml.readNext();
}
+ if (current_location.fileName() == "10_electric"){
+ QString qet_labels = "10_electric/qet_labels.xml";
+ QString filepath = QETApp::commonElementsDir().append(qet_labels);
+ QFile file(filepath);
+ file.isReadable();
+ if (!file.open(QFile::ReadOnly | QFile::Text))
+ return QString();
+
rxml.setDevice(&file);
rxml.readNext();
+ }
+
while(!rxml.atEnd())
{