Commit f2115095 authored by Denis Kurz's avatar Denis Kurz Committed by Denis Kurz

Simplify collecting multiple search folders

parent f919e137
......@@ -455,24 +455,16 @@ void SearchWindow::doSearch()
recursive = true;
}
} else if (mUi.mChkMultiFolders->isChecked()) {
if (!mSelectMultiCollectionDialog) {
if (mCollectionId.isEmpty()) {
mSearchPatternWidget->showWarningPattern(QStringList() << i18n("You forgot to select collections."));
return;
}
} else {
if (mSelectMultiCollectionDialog) {
mCollectionId = mSelectMultiCollectionDialog->selectedCollection();
}
searchCollections.reserve(mCollectionId.count());
for (const Akonadi::Collection &col : qAsConst(mCollectionId)) {
searchCollections << col;
}
if (searchCollections.isEmpty()) {
if (mCollectionId.isEmpty()) {
mUi.mSearchFolderEdt->setEnabled(true);
mSearchPatternWidget->showWarningPattern(QStringList() << i18n("You forgot to select collections."));
mQuery = Akonadi::SearchQuery();
return;
}
searchCollections << mCollectionId;
}
mUi.mPatternEdit->updateSearchPattern();
......
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