summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-08-11 03:58:08 (GMT)
committerToby Tomkins <toby.tomkins@nokia.com>2010-08-18 12:21:57 (GMT)
commit43483dba1fbb40bea5c69c3b87b7e2fc62371e57 (patch)
tree985eb9217bcee73a0a1b26be2c2115d563fa6f6e
parent946d1a895e9d7d87b45ae440b533745f35661969 (diff)
downloadQt-43483dba1fbb40bea5c69c3b87b7e2fc62371e57.zip
Qt-43483dba1fbb40bea5c69c3b87b7e2fc62371e57.tar.gz
Qt-43483dba1fbb40bea5c69c3b87b7e2fc62371e57.tar.bz2
Compile on Symbian
Task-number: QTBUG-12771 (cherry picked from commit e8d3e8e0b93271bb41fcdc264fc10ec59be5aa20)
-rw-r--r--src/declarative/util/qdeclarativelistmodel.cpp12
-rw-r--r--src/declarative/util/qdeclarativelistmodel_p_p.h12
2 files changed, 10 insertions, 14 deletions
diff --git a/src/declarative/util/qdeclarativelistmodel.cpp b/src/declarative/util/qdeclarativelistmodel.cpp
index b0d47a9..20fe3a9 100644
--- a/src/declarative/util/qdeclarativelistmodel.cpp
+++ b/src/declarative/util/qdeclarativelistmodel.cpp
@@ -1209,16 +1209,22 @@ ModelNode::ModelNode()
ModelNode::~ModelNode()
{
- qDeleteAll(properties.values());
+ clear();
+ if (modelCache) { modelCache->m_nested->_root = 0/* ==this */; delete modelCache; modelCache = 0; }
+ if (objectCache) { delete objectCache; objectCache = 0; }
+}
+void ModelNode::clear()
+{
ModelNode *node;
for (int ii = 0; ii < values.count(); ++ii) {
node = qvariant_cast<ModelNode *>(values.at(ii));
if (node) { delete node; node = 0; }
}
+ values.clear();
- if (modelCache) { modelCache->m_nested->_root = 0/* ==this */; delete modelCache; modelCache = 0; }
- if (objectCache) { delete objectCache; objectCache = 0; }
+ qDeleteAll(properties.values());
+ properties.clear();
}
void ModelNode::setObjectValue(const QScriptValue& valuemap) {
diff --git a/src/declarative/util/qdeclarativelistmodel_p_p.h b/src/declarative/util/qdeclarativelistmodel_p_p.h
index c41f016..8231414 100644
--- a/src/declarative/util/qdeclarativelistmodel_p_p.h
+++ b/src/declarative/util/qdeclarativelistmodel_p_p.h
@@ -158,17 +158,7 @@ struct ModelNode
QList<QVariant> values;
QHash<QString, ModelNode *> properties;
- void clear() {
- ModelNode *node;
- for (int ii = 0; ii < values.count(); ++ii) {
- node = qvariant_cast<ModelNode *>(values.at(ii));
- if (node) { delete node; node = 0; }
- }
- values.clear();
-
- qDeleteAll(properties.values());
- properties.clear();
- }
+ void clear();
QDeclarativeListModel *model(const NestedListModel *model) {
if (!modelCache) {