Commit 416c4b8f authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Do not show duplicate results from location and baloo runner

BUG: 347718
FIXED-IN: 5.21

If the file path is an exact match the location runner will
display a match, we do not want to duplicate that in baloo.
parent 2210d948
......@@ -37,6 +37,7 @@
#include <KIO/OpenFileManagerWindowJob>
#include <KIO/OpenUrlJob>
#include <KNotificationJobUiDelegate>
#include <KShell>
#include "krunner1adaptor.h"
......@@ -124,6 +125,11 @@ void SearchRunner::performMatch()
// Filter out duplicates
QSet<QUrl> foundUrls;
// The location runner handles file paths, otherwise we would end up with duplicate entries
QFileInfo fileInfo(KShell::tildeExpand(m_searchTerm));
if (fileInfo.exists()) {
foundUrls << QUrl::fromLocalFile(fileInfo.absoluteFilePath());
RemoteMatches matches;
matches << matchInternal(m_searchTerm, QStringLiteral("Audio"), i18n("Audio"), foundUrls);
Supports Markdown
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