mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
Improve code style, Wrap code for better readability
This commit is contained in:
@@ -836,12 +836,16 @@ QDomDocument QETProject::toXml() {
|
|||||||
|
|
||||||
// schemas
|
// schemas
|
||||||
|
|
||||||
// qDebug() << "Export XML de" << diagrams_.count() << "schemas";
|
qDebug() << "Export XML de" << m_diagrams_list.count() << "schemas";
|
||||||
int order_num = 1;
|
int order_num = 1;
|
||||||
const QList<Diagram *> diagrams_list = m_diagrams_list;
|
const QList<Diagram *> diagrams_list = m_diagrams_list;
|
||||||
for(Diagram *diagram : diagrams_list)
|
for(Diagram *diagram : diagrams_list)
|
||||||
{
|
{
|
||||||
qDebug() << qPrintable(QString("QETProject::toXml() : exporting diagram \"%1\"").arg(diagram -> title())) << "[" << diagram << "]";
|
qDebug() << QString("exporting diagram \"%1\""
|
||||||
|
).arg(diagram -> title())
|
||||||
|
<< "["
|
||||||
|
<< diagram
|
||||||
|
<< "]";
|
||||||
QDomElement xml_diagram = diagram->toXml().documentElement();
|
QDomElement xml_diagram = diagram->toXml().documentElement();
|
||||||
QDomNode xml_node = xml_doc.importNode(xml_diagram, true);
|
QDomNode xml_node = xml_doc.importNode(xml_diagram, true);
|
||||||
|
|
||||||
@@ -849,7 +853,7 @@ QDomDocument QETProject::toXml() {
|
|||||||
appended_diagram.toElement().setAttribute("order", order_num ++);
|
appended_diagram.toElement().setAttribute("order", order_num ++);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Write the elements collection.
|
// Write the elements collection.
|
||||||
project_root.appendChild(m_elements_collection->root().cloneNode(true));
|
project_root.appendChild(m_elements_collection->root().cloneNode(true));
|
||||||
|
|
||||||
return(xml_doc);
|
return(xml_doc);
|
||||||
@@ -1020,10 +1024,12 @@ ElementsLocation QETProject::importElement(ElementsLocation &location)
|
|||||||
}
|
}
|
||||||
//Element doesn't exist in the collection, we just import it
|
//Element doesn't exist in the collection, we just import it
|
||||||
else {
|
else {
|
||||||
ElementsLocation loc(m_elements_collection->addElement(location), this);
|
ElementsLocation loc(m_elements_collection->addElement(
|
||||||
|
location), this);
|
||||||
|
|
||||||
if (!loc.exist()) {
|
if (!loc.exist()) {
|
||||||
qDebug() << "QETProject::importElement : failed to import location. " << location;
|
qDebug() << "failed to import location. "
|
||||||
|
<< location;
|
||||||
return ElementsLocation();
|
return ElementsLocation();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in New Issue
Block a user