MCPcopy Create free account
hub / github.com/GilesBathgate/RapCAD / parseProject

Method parseProject

src/project.cpp:28–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28void Project::parseProject(const QString& filename)
29{
30 auto* file=new QFile(filename);
31 if(!file->open(QIODevice::ReadOnly | QIODevice::Text)) {
32 return;
33 }
34
35 QXmlStreamReader xml(file);
36 createRootItem();
37 while(!xml.atEnd() && !xml.hasError()) {
38 QXmlStreamReader::TokenType token = xml.readNext();
39 if(token == QXmlStreamReader::StartDocument) {
40 continue;
41 }
42 if(token == QXmlStreamReader::StartElement) {
43 if(xml.name() == "project") {
44
45 continue;
46 }
47 if(xml.name() == "name") {
48 parseName(xml);
49 }
50 if(xml.name() == "source") {
51 parseSource(xml);
52 }
53 }
54 }
55 delete file;
56}
57
58void Project::parseName(QXmlStreamReader& xml)
59{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected