Commit 5ee56038 authored by Laurent Montel's avatar Laurent Montel 😁

Backport "Always display number of results"

parent 070a49c5
......@@ -578,6 +578,9 @@ void SearchWindow::searchDone(KJob *job)
searchDescription->setRecursive(mUi.mChkSubFolders->isChecked());
new Akonadi::CollectionModifyJob(mFolder, this);
mSearchJob = Q_NULLPTR;
Akonadi::CollectionFetchJob *fetch = new Akonadi::CollectionFetchJob(mFolder, Akonadi::CollectionFetchJob::Base, this);
fetch->fetchScope().setIncludeStatistics(true);
connect(fetch, SIGNAL(result(KJob*)), this, SLOT(slotCollectionStatisticsRetrieved(KJob*)));
mUi.mStatusLbl->setText(i18n("Search complete."));
createSearchModel();
......@@ -593,6 +596,21 @@ void SearchWindow::searchDone(KJob *job)
}
}
void SearchWindow::slotCollectionStatisticsRetrieved(KJob *job)
{
Akonadi::CollectionFetchJob *fetch = qobject_cast<Akonadi::CollectionFetchJob*>(job);
if (!fetch || fetch->error()) {
return;
}
const Akonadi::Collection::List cols = fetch->collections();
if (cols.isEmpty()) {
return;
}
updateCollectionStatistic(cols[0].id(), cols[0].statistics());
}
void SearchWindow::slotStop()
{
mUi.mProgressIndicator->stop();
......
......@@ -143,6 +143,7 @@ private Q_SLOTS:
void slotPrintMsg();
/** GUI cleanup after search */
void slotCollectionStatisticsRetrieved(KJob *job);
void searchDone(KJob *);
void enableGUI();
......
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