summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorabcd <amos.choy@nokia.com>2012-01-06 10:51:44 +1000
committerQt by Nokia <qt-info@nokia.com>2012-01-06 06:55:44 +0100
commite532a721ea0090e0efb35b6903cfd06b6943d4ee (patch)
tree8b3ed290382c44880fb03c6fa7b9d901756cbcda
parent8d72c4ff58b044d9a6aaf537d60614ccd18109d6 (diff)
downloadqtlocation-e532a721ea0090e0efb35b6903cfd06b6943d4ee.tar.gz
Fix extra empty category retrieved when retrieving place details
A tree-like structure was being parsed into a flat list of categories. The empty root node was being treated as an empty category when it shouldn't be. There probably are better ways to refactor how processing of categories is done, but this fix should do for now. Change-Id: I367f777920dc99306a17c6e1a69cae52dda73e8d Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
-rw-r--r--src/plugins/geoservices/nokia/places/qplacejsoncategoriesparser.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/geoservices/nokia/places/qplacejsoncategoriesparser.cpp b/src/plugins/geoservices/nokia/places/qplacejsoncategoriesparser.cpp
index a35e67f8..11b4710a 100644
--- a/src/plugins/geoservices/nokia/places/qplacejsoncategoriesparser.cpp
+++ b/src/plugins/geoservices/nokia/places/qplacejsoncategoriesparser.cpp
@@ -96,8 +96,11 @@ QList<QPlaceCategory> QPlaceJSonCategoriesParser::parseFlatCategoryList(const QJ
processCategories(categories, QString(), &tree);
QList<QPlaceCategory> result;
- foreach (const PlaceCategoryNode &node, tree.values())
- result.append(node.category);
+ foreach (const PlaceCategoryNode &node, tree.values()) {
+ if (!node.category.categoryId().isEmpty())
+ result.append(node.category);
+ }
+
return result;
}