summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/3rdparty/qlistmodelinterface.cpp6
-rw-r--r--src/declarative/3rdparty/qlistmodelinterface_p.h1
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp2
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp25
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel_p.h1
5 files changed, 12 insertions, 23 deletions
diff --git a/src/declarative/3rdparty/qlistmodelinterface.cpp b/src/declarative/3rdparty/qlistmodelinterface.cpp
index 20501a0..98d6a5b 100644
--- a/src/declarative/3rdparty/qlistmodelinterface.cpp
+++ b/src/declarative/3rdparty/qlistmodelinterface.cpp
@@ -106,10 +106,4 @@ QT_BEGIN_NAMESPACE
\a roles changed.
*/
-/*! \fn void QListModelInterface::modelReset()
- Emit this signal when all of the model data has changed.
- This is more efficient than forcing the receivier to handle multiple
- inserted and removed signals etc.
-*/
-
QT_END_NAMESPACE
diff --git a/src/declarative/3rdparty/qlistmodelinterface_p.h b/src/declarative/3rdparty/qlistmodelinterface_p.h
index da91d12..07592ad 100644
--- a/src/declarative/3rdparty/qlistmodelinterface_p.h
+++ b/src/declarative/3rdparty/qlistmodelinterface_p.h
@@ -72,7 +72,6 @@ class Q_DECLARATIVE_EXPORT QListModelInterface : public QObject
void itemsRemoved(int index, int count);
void itemsMoved(int from, int to, int count);
void itemsChanged(int index, int count, const QList<int> &roles);
- void modelReset();
protected:
QListModelInterface(QObjectPrivate &dd, QObject *parent)
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index 174459b..dfd9c0c 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -662,7 +662,6 @@ void QDeclarativeVisualDataModel::setModel(const QVariant &model)
this, SLOT(_q_itemsRemoved(int,int)));
QObject::disconnect(d->m_listModelInterface, SIGNAL(itemsMoved(int,int,int)),
this, SLOT(_q_itemsMoved(int,int,int)));
- QObject::disconnect(d->m_listModelInterface, SIGNAL(modelReset()), this, SLOT(_q_modelReset()));
d->m_listModelInterface = 0;
} else if (d->m_abstractItemModel) {
QObject::disconnect(d->m_abstractItemModel, SIGNAL(rowsInserted(const QModelIndex &,int,int)),
@@ -706,7 +705,6 @@ void QDeclarativeVisualDataModel::setModel(const QVariant &model)
this, SLOT(_q_itemsRemoved(int,int)));
QObject::connect(d->m_listModelInterface, SIGNAL(itemsMoved(int,int,int)),
this, SLOT(_q_itemsMoved(int,int,int)));
- QObject::connect(d->m_listModelInterface, SIGNAL(modelReset()), this, SLOT(_q_modelReset()));
d->m_metaDataCacheable = true;
if (d->m_delegate && d->m_listModelInterface->count())
emit itemsInserted(0, d->m_listModelInterface->count());
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index 11c7305..b33af06 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -878,22 +878,21 @@ void QDeclarativeXmlListModel::queryCompleted(const QDeclarativeXmlQueryResult &
}
}
if (!hasKeys) {
- if (!(origCount == 0 && d->size == 0))
- emit modelReset();
+ if (!(origCount == 0 && d->size == 0)) {
+ emit itemsRemoved(0, origCount);
+ emit itemsInserted(0, d->size);
+ emit countChanged();
+ }
} else {
- if (result.removed.count() == 1 && result.removed[0].first == 0
- && result.removed[0].second == origCount) {
- emit modelReset();
- } else {
- for (int i=0; i<result.removed.count(); i++)
- emit itemsRemoved(result.removed[i].first, result.removed[i].second);
- for (int i=0; i<result.inserted.count(); i++)
- emit itemsInserted(result.inserted[i].first, result.inserted[i].second);
- if (sizeChanged)
- emit countChanged();
- }
+ for (int i=0; i<result.removed.count(); i++)
+ emit itemsRemoved(result.removed[i].first, result.removed[i].second);
+ for (int i=0; i<result.inserted.count(); i++)
+ emit itemsInserted(result.inserted[i].first, result.inserted[i].second);
+
+ if (sizeChanged)
+ emit countChanged();
}
emit statusChanged(d->status);
diff --git a/src/declarative/util/qdeclarativexmllistmodel_p.h b/src/declarative/util/qdeclarativexmllistmodel_p.h
index fd410a7..7b85476 100644
--- a/src/declarative/util/qdeclarativexmllistmodel_p.h
+++ b/src/declarative/util/qdeclarativexmllistmodel_p.h
@@ -124,7 +124,6 @@ Q_SIGNALS:
void xmlChanged();
void queryChanged();
void namespaceDeclarationsChanged();
- void modelReset();
public Q_SLOTS:
// ### need to use/expose Expiry to guess when to call this?