git-svn-id: file:///svnroot/family-shop-mgr@19 26eb2498-383b-47a6-be48-5d6f36779e85
[family-shop-mgr] / code / family-shop-mgr / ShoppingTreeModel.cpp
index 4a485e8..0a65d9d 100644 (file)
@@ -314,7 +314,8 @@ void ShoppingTreeModel::parseCategoryElement(const QDomElement &element,
         parentItem = rootItem;\r
 \r
     ShoppingTreeItem *item;\r
-    QString title = element.firstChildElement("title").text();\r
+    QDomElement child = element.firstChildElement("title");\r
+    QString title = child.text();\r
     if(!title.isEmpty())\r
     {\r
         parentItem->insertChildren(parentItem->childCount(), 1,\r
@@ -334,7 +335,7 @@ void ShoppingTreeModel::parseCategoryElement(const QDomElement &element,
     }\r
 \r
     // add each sub category and item to the tree\r
-    QDomElement child = element.firstChildElement();\r
+    child = child.nextSiblingElement();\r
     while(!child.isNull())\r
     {\r
         if(child.tagName() == "category")\r