| 26 | } |
| 27 | |
| 28 | void 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 | |
| 58 | void Project::parseName(QXmlStreamReader& xml) |
| 59 | { |
nothing calls this directly
no outgoing calls
no test coverage detected