Commit 2dc7fbf5 authored by Martin Koller's avatar Martin Koller Committed by David Faure

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

(cherry picked from commit 33d86e16)
parent eae2c9a1
......@@ -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;
}
......
......@@ -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 &);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment