Improve code style, Wrap code for better readability

This commit is contained in:
Simon De Backer
2020-08-17 21:24:46 +02:00
parent b28ca0361d
commit b5f212418c

View File

@@ -836,12 +836,16 @@ QDomDocument QETProject::toXml() {
// schemas
// qDebug() << "Export XML de" << diagrams_.count() << "schemas";
qDebug() << "Export XML de" << m_diagrams_list.count() << "schemas";
int order_num = 1;
const QList<Diagram *> diagrams_list = m_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();
QDomNode xml_node = xml_doc.importNode(xml_diagram, true);
@@ -849,7 +853,7 @@ QDomDocument QETProject::toXml() {
appended_diagram.toElement().setAttribute("order", order_num ++);
}
//Write the elements collection.
// Write the elements collection.
project_root.appendChild(m_elements_collection->root().cloneNode(true));
return(xml_doc);
@@ -1020,10 +1024,12 @@ ElementsLocation QETProject::importElement(ElementsLocation &location)
}
//Element doesn't exist in the collection, we just import it
else {
ElementsLocation loc(m_elements_collection->addElement(location), this);
ElementsLocation loc(m_elements_collection->addElement(
location), this);
if (!loc.exist()) {
qDebug() << "QETProject::importElement : failed to import location. " << location;
qDebug() << "failed to import location. "
<< location;
return ElementsLocation();
}
else {