mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 14:50:53 +01:00
Element Auto Numbering now works for all languages.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4565 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -271,7 +271,6 @@ void CustomElement::paint(QPainter *qp, const QStyleOptionGraphicsItem *options)
|
|||||||
instructions.
|
instructions.
|
||||||
*/
|
*/
|
||||||
void CustomElement::parseLabels() {
|
void CustomElement::parseLabels() {
|
||||||
return;
|
|
||||||
if ((this->taggedText("label")!= NULL) && (location().projectId()!=-1) && (this->taggedText("label")->toPlainText()=="_")) { //element is being added
|
if ((this->taggedText("label")!= NULL) && (location().projectId()!=-1) && (this->taggedText("label")->toPlainText()=="_")) { //element is being added
|
||||||
QXmlStreamReader rxml;
|
QXmlStreamReader rxml;
|
||||||
QString path[10];
|
QString path[10];
|
||||||
@@ -281,7 +280,7 @@ void CustomElement::parseLabels() {
|
|||||||
int dirLevel = -1;
|
int dirLevel = -1;
|
||||||
|
|
||||||
//Add location name to path array
|
//Add location name to path array
|
||||||
while(current_location.parent().name()!="Imported elements" ) {
|
while(current_location.parent().fileName() != "import") {
|
||||||
i++;
|
i++;
|
||||||
path[i]=current_location.fileName();
|
path[i]=current_location.fileName();
|
||||||
current_location = current_location.parent();
|
current_location = current_location.parent();
|
||||||
@@ -289,7 +288,7 @@ void CustomElement::parseLabels() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Only Electric labels created so far
|
// Only Electric labels created so far
|
||||||
if (current_location.name()!= "Electric") return;
|
if (current_location.fileName() != "10_electric") return;
|
||||||
QString qet_labels = "10_electric/qet_labels.xml";
|
QString qet_labels = "10_electric/qet_labels.xml";
|
||||||
QString filepath = QETApp::commonElementsDir().append(qet_labels);
|
QString filepath = QETApp::commonElementsDir().append(qet_labels);
|
||||||
QFile file(filepath);
|
QFile file(filepath);
|
||||||
|
|||||||
Reference in New Issue
Block a user