aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Koller <[email protected]>2017-05-06 11:30:06 +0200
committerMartin Koller <[email protected]>2017-05-06 11:30:06 +0200
commit33d86e165c5fe150583f9ac3ab58626ffcfe4f97 (patch)
tree71ac82c8df005fecb91f0419cb2d8db5a88a59f1
parenta9437332d725b346a794393ce91db93eff1f6a33 (diff)
Explicitely pass source collection to ensure moving mails work
... since the passed item.parentCollection() is already the target collection Differential Revision: https://phabricator.kde.org/D5711
-rw-r--r--src/core/models/entitytreemodel_p.cpp9
-rw-r--r--src/core/models/entitytreemodel_p.h2
2 files changed, 6 insertions, 5 deletions
diff --git a/src/core/models/entitytreemodel_p.cpp b/src/core/models/entitytreemodel_p.cpp
index 7c75746..79f0c04 100644
--- a/src/core/models/entitytreemodel_p.cpp
+++ b/src/core/models/entitytreemodel_p.cpp
@@ -1104,7 +1104,7 @@ void EntityTreeModelPrivate::monitoredItemAdded(const Akonadi::Item &item, const
q->endInsertRows();
}
-void EntityTreeModelPrivate::monitoredItemRemoved(const Akonadi::Item &item)
+void EntityTreeModelPrivate::monitoredItemRemoved(const Akonadi::Item &item, const Akonadi::Collection &parentCollection)
{
Q_Q(EntityTreeModel);
@@ -1112,7 +1112,8 @@ void EntityTreeModelPrivate::monitoredItemRemoved(const Akonadi::Item &item)
return;
}
- if ((m_itemPopulation == EntityTreeModel::LazyPopulation) && !m_populatedCols.contains(item.parentCollection().id())) {
+ if ((m_itemPopulation == EntityTreeModel::LazyPopulation) &&
+ !m_populatedCols.contains(parentCollection.isValid() ? parentCollection.id() : item.parentCollection().id())) {
return;
}
@@ -1197,10 +1198,10 @@ void EntityTreeModelPrivate::monitoredItemMoved(const Akonadi::Item &item,
monitoredItemAdded(item, destCollection);
return;
} else if (isHidden(destCollection)) {
- monitoredItemRemoved(item);
+ monitoredItemRemoved(item, sourceCollection);
return;
} else {
- monitoredItemRemoved(item);
+ monitoredItemRemoved(item, sourceCollection);
monitoredItemAdded(item, destCollection);
return;
}
diff --git a/src/core/models/entitytreemodel_p.h b/src/core/models/entitytreemodel_p.h
index 9c5e5ac..1d90abb 100644
--- a/src/core/models/entitytreemodel_p.h
+++ b/src/core/models/entitytreemodel_p.h
@@ -93,7 +93,7 @@ public:
const Akonadi::Collection &destCollection);
void monitoredItemAdded(const Akonadi::Item &item, const Akonadi::Collection &collection);
- void monitoredItemRemoved(const Akonadi::Item &item);
+ void monitoredItemRemoved(const Akonadi::Item &item, const Akonadi::Collection &collection = Akonadi::Collection());
void monitoredItemChanged(const Akonadi::Item &item, const QSet<QByteArray> &);
void monitoredItemMoved(const Akonadi::Item &item, const Akonadi::Collection &, const Akonadi::Collection &);