summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-08-11 03:58:08 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-08-11 03:58:08 (GMT)
commite8d3e8e0b93271bb41fcdc264fc10ec59be5aa20 (patch)
tree72e288ac19dd7051f862f7dc552d866d3f4024b9
parentc170e75cd3af746cfec80ff7d5feb44228a329c3 (diff)
downloadQt-e8d3e8e0b93271bb41fcdc264fc10ec59be5aa20.zip
Qt-e8d3e8e0b93271bb41fcdc264fc10ec59be5aa20.tar.gz
Qt-e8d3e8e0b93271bb41fcdc264fc10ec59be5aa20.tar.bz2
Compile on Symbian
Task-number: QTBUG-12771
-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) {