diff options
author | Michael Krasnyk <mkrasnyk@luxoft.com> | 2013-12-13 16:06:53 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-15 02:55:00 +0100 |
commit | 88fa07b22bd50d85e15dcbdafa89198001754b89 (patch) | |
tree | 384ed281c5325ee37a443462f2ef616d4c9cc03b /src/plugins/organizer/memory/qorganizeritemmemorybackend.cpp | |
parent | b152468c007faf9ea5ba67365e4b588e53dd7342 (diff) |
Qt Organizer: do not emit unnecessary collectionsChanged signals
Prevent emitting of unnecessary collectionsChanged signals
without collections modifications. These signals lead
to a reset without real changes of collections models
based on QList.
Change-Id: I7d36209e40c62a2c7d43340e645b3567754470b3
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src/plugins/organizer/memory/qorganizeritemmemorybackend.cpp')
-rw-r--r-- | src/plugins/organizer/memory/qorganizeritemmemorybackend.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/organizer/memory/qorganizeritemmemorybackend.cpp b/src/plugins/organizer/memory/qorganizeritemmemorybackend.cpp index 82f2c8992..177f6bfae 100644 --- a/src/plugins/organizer/memory/qorganizeritemmemorybackend.cpp +++ b/src/plugins/organizer/memory/qorganizeritemmemorybackend.cpp @@ -1322,10 +1322,13 @@ bool QOrganizerItemMemoryEngine::saveCollection(QOrganizerCollection* collection // if it's not the default collection, they can do whatever they like. A collection does not need any metadata to be valid. for (int i = 0; i < d->m_organizerCollectionIds.size(); ++i) { if (d->m_organizerCollectionIds.at(i) == colId) { - // this collection already exists. update our internal list. - d->m_organizerCollections.replace(i, *collection); - cs.insertChangedCollection(colId); - cs.emitSignals(this); + // this collection already exists. update our internal list + // if the collection has been modified. + if (d->m_organizerCollections.at(i) != *collection) { + d->m_organizerCollections.replace(i, *collection); + cs.insertChangedCollection(colId); + cs.emitSignals(this); + } return true; } } |