while xml atEnd xml readNext if xml isStartElement if xml name QLatin1

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
while (!xml.atEnd()) {
xml.readNext();
if (xml.isStartElement()) {
if (xml.name() == QLatin1String("id")) {
buildservice.setId(xml.readElementText());
} else if (xml.name() == QLatin1String("name")) {
buildservice.setName(xml.readElementText());
} else if (xml.name() == QLatin1String("registrationurl")) {
buildservice.setUrl(xml.readElementText());
} else if (xml.name() == QLatin1String("supportedtargets")) {
while (!xml.atEnd()) {
xml.readNextStartElement();
if (xml.isStartElement()) {
if (xml.name() == QLatin1String("target")) {
Target t;
while (!xml.atEnd()) {
xml.readNextStartElement();
if (xml.isStartElement()) {
if (xml.name() == QLatin1String("id")) {
t.id = xml.readElementText();
} else if (xml.name() == QLatin1String("name")) {
t.name = xml.readElementText();
}
} else if (xml.isEndElement() && (xml.name() == QLatin1String("target"))) {
xml.readNext();
break;
}
}
buildservice.addTarget(t);
}
} else if (xml.isEndElement() && (xml.name() == QLatin1String("supportedtargets"))) {
xml.readNext();
break;
}
}
}
} else if (xml.isEndElement()
&& ((xml.name() == QLatin1String("buildservice"))
|| (xml.name() == QLatin1String("user")))) {
break;
}
}