[Baloo Runner] Strip filename from subtext

The main text is already the filename
wilder-5.14
Kai Uwe Broulik 10 years ago
parent cc5ac26687
commit 5611b9cf2c
  1. 8
      runners/baloo/baloosearchrunner.cpp

@ -18,7 +18,6 @@
* *
*/ */
#include "baloosearchrunner.h" #include "baloosearchrunner.h"
#include <QAction> #include <QAction>
@ -125,10 +124,11 @@ QList<Plasma::QueryMatch> SearchRunner::match(Plasma::RunnerContext& context, co
match.setRelevance(relevance); match.setRelevance(relevance);
relevance -= 0.05; relevance -= 0.05;
if (localUrl.startsWith(QDir::homePath())) { QString folderPath = url.adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash).toLocalFile();
localUrl.replace(0, QDir::homePath().length(), QStringLiteral("~")); if (folderPath.startsWith(QDir::homePath())) {
folderPath.replace(0, QDir::homePath().length(), QStringLiteral("~"));
} }
match.setSubtext(localUrl); match.setSubtext(folderPath);
matches << match; matches << match;
} }

Loading…
Cancel
Save