summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateu Batle <mateu.batle@collabora.co.uk>2011-06-28 19:42:28 -0500
committerMateu Batle <mateu.batle@collabora.co.uk>2011-06-28 19:43:51 -0500
commitd9905e0278298fedfe59fd63bcaa1b79614a3f25 (patch)
tree82dcf28122af6fe0a9b8cdfb173cada0e9f9bc6f
parent534239c4b62e791989bcf38e2dcc380ac521ca8d (diff)
Fix bug, flat model proxy should not do any data change notification for accounts, just for contacts. This change improves performance.
-rw-r--r--TelepathyQt4Yell/Models/flat-model-proxy.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/TelepathyQt4Yell/Models/flat-model-proxy.cpp b/TelepathyQt4Yell/Models/flat-model-proxy.cpp
index e9cf5b6..86d21e5 100644
--- a/TelepathyQt4Yell/Models/flat-model-proxy.cpp
+++ b/TelepathyQt4Yell/Models/flat-model-proxy.cpp
@@ -168,15 +168,7 @@ void FlatModelProxy::onRowsRemoved(const QModelIndex &index, int first, int last
void FlatModelProxy::onDataChanged(const QModelIndex &first, const QModelIndex &last)
{
- if (!first.parent().isValid()) {
- int firstOffset = mPriv->offsetOf(this, first.row());
- int lastOffset = mPriv->offsetOf(this, last.row() + 1) - 1;
-
- QModelIndex firstIndex = createIndex(firstOffset, 0, first.row());
- QModelIndex lastIndex = createIndex(lastOffset, 0, last.row());
- emit dataChanged(firstIndex, lastIndex);
- }
- else if (first.parent() == last.parent()) {
+ if (first.parent().isValid() && last.parent().isValid() && first.parent() == last.parent()) {
QModelIndex firstIndex = mapFromSource(first);
QModelIndex lastIndex = mapFromSource(last);
emit dataChanged(firstIndex, lastIndex);