[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [muon/newui] installer/CategoryView: Fix crash regarding subcategories destruction.
From: Aleix Pol <aleixpol () kde ! org>
Date: 2012-02-01 4:34:34
Message-ID: 20120201043434.A5F51A60C6 () git ! kde ! org
[Download RAW message or body]
Git commit 956d5304a356a1731bbf080fadd4485bc86e0a62 by Aleix Pol.
Committed on 01/02/2012 at 05:30.
Pushed by apol into branch 'newui'.
Fix crash regarding subcategories destruction.
let the QObject infrastructure delete them
M +3 -3 installer/CategoryView/Category.cpp
http://commits.kde.org/muon/956d5304a356a1731bbf080fadd4485bc86e0a62
diff --git a/installer/CategoryView/Category.cpp b/installer/CategoryView/Category.cpp
index 9f66b36..a3aa188 100644
--- a/installer/CategoryView/Category.cpp
+++ b/installer/CategoryView/Category.cpp
@@ -36,9 +36,7 @@ Category::Category(const QDomNode &data, CategoryChildPolicy policy)
}
Category::~Category()
-{
- qDeleteAll(m_subCategories);
-}
+{}
void Category::parseData(const QDomNode &data)
{
@@ -62,6 +60,7 @@ void Category::parseData(const QDomNode &data)
} else if (tempElement.tagName() == QLatin1String("Menu")) {
if (m_policy == CanHaveChildren) {
Category *subCategory = new Category(node);
+ subCategory->setParent(this);
m_subCategories << subCategory;
m_hasSubCategories = true;
}
@@ -74,6 +73,7 @@ void Category::parseData(const QDomNode &data)
if (m_hasSubCategories) {
Category *allSubCategory = new Category(data, NoChildren);
+ allSubCategory->setParent(this);
m_subCategories << allSubCategory;
}
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic