Skip to content

Commit

Permalink
Merge pull request #96 from jacquetc/develop
Browse files Browse the repository at this point in the history
- add separator handling in Plume importer
  • Loading branch information
jacquetc authored Nov 15, 2020
2 parents 0018d43 + 34aa4bb commit 01951c9
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/libskribisto-data/src/tasks/sql/plmimporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,14 +433,19 @@ SKRResult PLMImporter::importPlumeCreatorProject(const QUrl& plumeFileName, cons

}
}
while (xml.readNext() != QXmlStreamReader::EndDocument){

}


}

IFKO(result) {
result = SKRResult(SKRResult::Critical, this, "error_while_exploiting_tree");
return result;
}

if (xml.hasError()) {
if (xml.hasError() && xml.error() != QXmlStreamReader::PrematureEndOfDocumentError) {
result = SKRResult(SKRResult::Critical, this, "error_in_tree_xml");

result.addData("xmlError", QString("%1\nLine %2, column %3")
Expand Down Expand Up @@ -508,16 +513,27 @@ SKRResult PLMImporter::readXMLRecursivelyAndCreatePaper(int
return result;
}
else {
IFOKDO(result, this->createPapersAndAssociations(projectId, indent, *xml, tempDirPath));
IFOKDO(result, readXMLRecursivelyAndCreatePaper(projectId, indent + 1, xml, tempDirPath));
if(xml->name() == "separator"){
xml->skipCurrentElement();
}
else {
IFOKDO(result, this->createPapersAndAssociations(projectId, indent, *xml, tempDirPath));
IFOKDO(result, readXMLRecursivelyAndCreatePaper(projectId, indent + 1, xml, tempDirPath));
}
}

while (xml->readNextStartElement()) {

if(xml->name() == "separator"){
xml->skipCurrentElement();
continue;
}
IFOKDO(result, this->createPapersAndAssociations(projectId, indent, *xml, tempDirPath));
IFOKDO(result, readXMLRecursivelyAndCreatePaper(projectId, indent + 1, xml, tempDirPath));

}

return result;
}


Expand Down

0 comments on commit 01951c9

Please sign in to comment.