Merge lp:~marcustomlinson/qtcreator-plugin-ubuntu/fix-xml-scope-templates into lp:qtcreator-plugin-ubuntu

Proposed by Marcus Tomlinson on 2015-11-13
Status: Merged
Approved by: Benjamin Zeller on 2015-11-13
Approved revision: 420
Merged at revision: 420
Proposed branch: lp:~marcustomlinson/qtcreator-plugin-ubuntu/fix-xml-scope-templates
Merge into: lp:qtcreator-plugin-ubuntu
Diff against target: 51 lines (+4/-12)
2 files modified
share/qtcreator/templates/wizards/ubuntu/scope-14.10/src/api/client.cpp (+2/-6)
share/qtcreator/templates/wizards/ubuntu/scope/src/client.cpp (+2/-6)
To merge this branch: bzr merge lp:~marcustomlinson/qtcreator-plugin-ubuntu/fix-xml-scope-templates
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve on 2015-11-13
Benjamin Zeller (community) 2015-11-13 Approve on 2015-11-13
Review via email: mp+277434@code.launchpad.net

Commit message

Fix mistake in XML scope templates where only odd numbered XML nodes where being read, causing a blank top level "City, Country" title (second node in XML)

To post a comment you must log in.
Benjamin Zeller (zeller-benjamin) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'share/qtcreator/templates/wizards/ubuntu/scope-14.10/src/api/client.cpp'
2--- share/qtcreator/templates/wizards/ubuntu/scope-14.10/src/api/client.cpp 2015-10-21 11:14:10 +0000
3+++ share/qtcreator/templates/wizards/ubuntu/scope-14.10/src/api/client.cpp 2015-11-13 11:40:32 +0000
4@@ -353,9 +353,7 @@
5
6 /* If token is StartElement, we'll see if we can read it.*/
7 if (token == QXmlStreamReader::StartElement) {
8- if (root.name() == "current") {
9- root.readNext();
10- } else if (root.name() == "city") {
11+ if (root.name() == "city") {
12 parseCity(result.city, root);
13 } else if (root.name() == "weather") {
14 parseWeather(result.weather, root);
15@@ -464,9 +462,7 @@
16
17 /* If token is StartElement, we'll see if we can read it.*/
18 if (token == QXmlStreamReader::StartElement) {
19- if (root.name() == "weatherdata") {
20- root.readNext();
21- } else if (root.name() == "location") {
22+ if (root.name() == "location") {
23 parseLocation(result.city, root);
24 } else if (root.name() == "forecast") {
25 parseForecast(result.weather, root);
26
27=== modified file 'share/qtcreator/templates/wizards/ubuntu/scope/src/client.cpp'
28--- share/qtcreator/templates/wizards/ubuntu/scope/src/client.cpp 2015-10-21 11:14:10 +0000
29+++ share/qtcreator/templates/wizards/ubuntu/scope/src/client.cpp 2015-11-13 11:40:32 +0000
30@@ -352,9 +352,7 @@
31
32 /* If token is StartElement, we'll see if we can read it.*/
33 if (token == QXmlStreamReader::StartElement) {
34- if (root.name() == "current") {
35- root.readNext();
36- } else if (root.name() == "city") {
37+ if (root.name() == "city") {
38 parseCity(result.city, root);
39 } else if (root.name() == "weather") {
40 parseWeather(result.weather, root);
41@@ -463,9 +461,7 @@
42
43 /* If token is StartElement, we'll see if we can read it.*/
44 if (token == QXmlStreamReader::StartElement) {
45- if (root.name() == "weatherdata") {
46- root.readNext();
47- } else if (root.name() == "location") {
48+ if (root.name() == "location") {
49 parseLocation(result.city, root);
50 } else if (root.name() == "forecast") {
51 parseForecast(result.weather, root);

Subscribers

People subscribed via source and target branches