From 2fa8e07a2cff5fd6ff0800e746e0316362b0b607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= <daniel.vratil@kdab.com> Date: Thu, 18 Feb 2016 16:38:23 +0100 Subject: [PATCH 45/74] Search: resolve search collections from ETM even for non-recursive search ETM does have CollectionStatistics available, the Collections directly from the selector in Search window do not. --- kmail/searchdialog/searchwindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kmail/searchdialog/searchwindow.cpp b/kmail/searchdialog/searchwindow.cpp index ae92ceb2f5..a12c57a1f4 100644 --- a/kmail/searchdialog/searchwindow.cpp +++ b/kmail/searchdialog/searchwindow.cpp @@ -881,7 +881,11 @@ QVector<qint64> SearchWindow::checkIncompleteIndex(const Akonadi::Collection::Li if (recursive) { cols = searchCollectionsRecursive(searchCols); } else { - cols = searchCols; + Q_FOREACH (const Akonadi::Collection &col, searchCols) { + QAbstractItemModel *etm = KMKernel::self()->collectionModel(); + const QModelIndex idx = Akonadi::EntityTreeModel::modelIndexForCollection(etm, col); + cols.push_back(etm->data(idx, Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>()); + } } PimCommon::CollectionIndexStatusJob *statsJob = new PimCommon::CollectionIndexStatusJob(cols, this); -- 2.14.1