From b489d93e3988f7428f8a6abb15f6c665f45694fd0510fd0e3f7ea50972fdc1bc Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Wed, 22 Oct 2014 23:29:06 +0000 Subject: [PATCH 1/3] OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/plasma5-workspace?expand=0&rev=29 --- ...onvert-case-insensitive-path-to-a-pr.patch | 80 +++++++++++++++++++ ...er-relevance-because-krunner-does-no.patch | 50 ++++++++++++ plasma5-workspace.changes | 8 ++ plasma5-workspace.spec | 8 ++ 4 files changed, 146 insertions(+) create mode 100644 0001-LocationRunner-Convert-case-insensitive-path-to-a-pr.patch create mode 100644 0002-Baloo-Runner-Lower-relevance-because-krunner-does-no.patch diff --git a/0001-LocationRunner-Convert-case-insensitive-path-to-a-pr.patch b/0001-LocationRunner-Convert-case-insensitive-path-to-a-pr.patch new file mode 100644 index 0000000..1069a21 --- /dev/null +++ b/0001-LocationRunner-Convert-case-insensitive-path-to-a-pr.patch @@ -0,0 +1,80 @@ +From 1ae78f08474878e60d086ea60e933d62228eac2f Mon Sep 17 00:00:00 2001 +From: Vishesh Handa +Date: Fri, 17 Oct 2014 17:45:42 +0200 +Subject: [PATCH 1/2] LocationRunner: Convert case insensitive path to a proper + one + +BUG: 333395 +FIXED-IN: 5.2 +--- + runners/locations/locationrunner.cpp | 40 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + +diff --git a/runners/locations/locationrunner.cpp b/runners/locations/locationrunner.cpp +index 13035a9..0b79655 100644 +--- a/runners/locations/locationrunner.cpp ++++ b/runners/locations/locationrunner.cpp +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -129,6 +130,43 @@ void LocationsRunner::match(Plasma::RunnerContext &context) + } + } + ++static QString convertCaseInsensitivePath(const QString& path) ++{ ++ // Split the string on / ++ QStringList dirNames = path.split(QDir::separator(), QString::SkipEmptyParts); ++ ++ // Match folders ++ QDir dir("/"); ++ for (int i = 0; i < dirNames.size() - 1; i++) { ++ QString dirName = dirNames[i]; ++ ++ bool foundMatch = false; ++ QStringList entries = dir.entryList(QDir::Dirs); ++ for (const QString& entry: entries) { ++ if (entry.compare(dirName, Qt::CaseInsensitive) == 0) { ++ foundMatch = dir.cd(entry); ++ if (foundMatch) { ++ break; ++ } ++ } ++ } ++ ++ if (!foundMatch) { ++ return path; ++ } ++ } ++ ++ QString finalName = dirNames.last(); ++ QStringList entries = dir.entryList(); ++ for (const QString& entry: entries) { ++ if (entry.compare(finalName, Qt::CaseInsensitive) == 0) { ++ return dir.absoluteFilePath(entry); ++ } ++ } ++ ++ return path; ++} ++ + void LocationsRunner::run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) + { + Q_UNUSED(match) +@@ -139,6 +177,8 @@ void LocationsRunner::run(const Plasma::RunnerContext &context, const Plasma::Qu + return; + } + ++ location = convertCaseInsensitivePath(location); ++ + //qDebug() << "command: " << context.query(); + //qDebug() << "url: " << location << data; + +-- +2.1.2 + diff --git a/0002-Baloo-Runner-Lower-relevance-because-krunner-does-no.patch b/0002-Baloo-Runner-Lower-relevance-because-krunner-does-no.patch new file mode 100644 index 0000000..308a7d9 --- /dev/null +++ b/0002-Baloo-Runner-Lower-relevance-because-krunner-does-no.patch @@ -0,0 +1,50 @@ +From 1fc19e8dfb8290ad7d21ba8f8913160f880a095b Mon Sep 17 00:00:00 2001 +From: Vishesh Handa +Date: Tue, 21 Oct 2014 17:59:40 +0200 +Subject: [PATCH 2/2] Baloo Runner: Lower relevance because krunner does not + know any better + +The KRunner framework expects all runners to set a relevance for each +match, except that this relevance information is taken to globally sort +the results. So I can write a plugin which whose results will always be +on top. Yaye! + +Explicitly lower Baloo's relevance so that in general applications are +higher. +--- + runners/baloo/baloosearchrunner.cpp | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/runners/baloo/baloosearchrunner.cpp b/runners/baloo/baloosearchrunner.cpp +index 996f719..115abd0 100644 +--- a/runners/baloo/baloosearchrunner.cpp ++++ b/runners/baloo/baloosearchrunner.cpp +@@ -99,7 +99,13 @@ void SearchRunner::match(Plasma::RunnerC + + Baloo::ResultIterator it = query.exec(); + +- int relevance = 100; ++ // KRunner is absolutely retarded and allows plugins to set the global ++ // relevance levels. so Baloo should not set the relevance of results too ++ // high because then Applications will often appear after if the application ++ // runner has not a higher relevance. So stupid. ++ // Each runner plugin should not have to know about the others. ++ // Anyway, that's why we're starting with .75 ++ float relevance = .75; + while (context.isValid() && it.next()) { + Plasma::QueryMatch match(this); + match.setIcon(QIcon::fromTheme(it.icon())); +@@ -108,8 +114,8 @@ void SearchRunner::match(Plasma::RunnerC + match.setData(it.url()); + match.setType(Plasma::QueryMatch::PossibleMatch); + match.setMatchCategory(category); +- match.setRelevance(relevance * .01); +- relevance--; ++ match.setRelevance(relevance); ++ relevance -= 0.05; + + QString url = it.url().toLocalFile(); + if (url.startsWith(QDir::homePath())) { +-- +2.1.2 + diff --git a/plasma5-workspace.changes b/plasma5-workspace.changes index b39044f..ee09f6a 100644 --- a/plasma5-workspace.changes +++ b/plasma5-workspace.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Oct 22 23:27:48 UTC 2014 - hrvoje.senjan@gmail.com + +- Added + 0001-LocationRunner-Convert-case-insensitive-path-to-a-pr.patch (kde#333395) + and 0002-Baloo-Runner-Lower-relevance-because-krunner-does-no.patch, + make sure that applications are shown as top results in krunner + ------------------------------------------------------------------- Thu Oct 9 21:24:39 UTC 2014 - hrvoje.senjan@gmail.com diff --git a/plasma5-workspace.spec b/plasma5-workspace.spec index 7451490..df10f2d 100644 --- a/plasma5-workspace.spec +++ b/plasma5-workspace.spec @@ -32,6 +32,12 @@ Patch0: 0001-Rename-qdbus-in-startkde.patch Patch1: create_kdehome.patch # PATCH-FIX_OPENSUSE 0003-Remove-export-of-QT_PLUGIN_PATH.patch -- we install plugins to directory known to Qt5, so export just pollutes both Qt4 and Qt5 plugins Patch2: 0003-Remove-export-of-QT_PLUGIN_PATH.patch +# PATCHES 100-1000 and above are from upstream 5.1 branch +# PATCHES 1000 and above are from upstream master/5.2 branch +# PATCH-FIX-UPSTREAM 0001-LocationRunner-Convert-case-insensitive-path-to-a-pr.patch -- kde#333395 +Patch1000: 0001-LocationRunner-Convert-case-insensitive-path-to-a-pr.patch +# PATCH-FIX-UPSTREAM 0002-Baloo-Runner-Lower-relevance-because-krunner-does-no.patch -- make sure that applications are shown as top results in krunner +Patch1001: 0002-Baloo-Runner-Lower-relevance-because-krunner-does-no.patch BuildRequires: alsa-devel BuildRequires: baloo5-devel >= 5.0.0 BuildRequires: kactivities5-devel >= 5.0.0 @@ -175,6 +181,8 @@ workspace. Development files. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch1000 -p1 +%patch1001 -p1 %build %cmake_kf5 -d build -- -DKDE4_COMMON_PAM_SERVICE=xdm -DKDE_DEFAULT_HOME=.kde4 -DCMAKE_INSTALL_LOCALEDIR=share/locale/kf5 From 6d2d36e5049ee52b9a1df55215fa69a0bfe9d5d59b1ebed4ac6826c047306bbd Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Sat, 25 Oct 2014 17:22:40 +0000 Subject: [PATCH 2/3] OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/plasma5-workspace?expand=0&rev=30 --- plasma5-workspace.changes | 1 + plasma5-workspace.spec | 1 + 2 files changed, 2 insertions(+) diff --git a/plasma5-workspace.changes b/plasma5-workspace.changes index ee09f6a..5b3363f 100644 --- a/plasma5-workspace.changes +++ b/plasma5-workspace.changes @@ -5,6 +5,7 @@ Wed Oct 22 23:27:48 UTC 2014 - hrvoje.senjan@gmail.com 0001-LocationRunner-Convert-case-insensitive-path-to-a-pr.patch (kde#333395) and 0002-Baloo-Runner-Lower-relevance-because-krunner-does-no.patch, make sure that applications are shown as top results in krunner +- Recommend lang subpackage ------------------------------------------------------------------- Thu Oct 9 21:24:39 UTC 2014 - hrvoje.senjan@gmail.com diff --git a/plasma5-workspace.spec b/plasma5-workspace.spec index df10f2d..6158fdc 100644 --- a/plasma5-workspace.spec +++ b/plasma5-workspace.spec @@ -124,6 +124,7 @@ Recommends: phonon4qt5-backend Recommends: systemsettings5 # so Qt4-only apps have some colors in tray Recommends: sni-qt +Recommends: %{name}-lang BuildRoot: %{_tmppath}/%{name}-%{version}-build %description From 5325640243a4c8edb969cf1ab4060eef841eaed1b32d83d3d5a126467b686a8a Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Wed, 29 Oct 2014 22:27:22 +0000 Subject: [PATCH 3/3] OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/plasma5-workspace?expand=0&rev=31 --- plasma5-workspace.changes | 2 ++ plasma5-workspace.spec | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plasma5-workspace.changes b/plasma5-workspace.changes index 5b3363f..c3da500 100644 --- a/plasma5-workspace.changes +++ b/plasma5-workspace.changes @@ -6,6 +6,8 @@ Wed Oct 22 23:27:48 UTC 2014 - hrvoje.senjan@gmail.com and 0002-Baloo-Runner-Lower-relevance-because-krunner-does-no.patch, make sure that applications are shown as top results in krunner - Recommend lang subpackage +- Relax dependancies to plasma-framework private parts, and fix + a blip moment, typo in package name ------------------------------------------------------------------- Thu Oct 9 21:24:39 UTC 2014 - hrvoje.senjan@gmail.com diff --git a/plasma5-workspace.spec b/plasma5-workspace.spec index 6158fdc..9081081 100644 --- a/plasma5-workspace.spec +++ b/plasma5-workspace.spec @@ -112,8 +112,8 @@ Requires: solid-imports Requires: frameworkintegration-plugin Requires: libkscreen2-plugin # hardcode versions of plasma-framework-componets and plasma-framework-private packages, as upstream doesn't keep backwards compability there -%requires_eq plasma-framework-componets -%requires_eq plasma-framework-private +%requires_ge plasma-framework-components +%requires_ge plasma-framework-private # de-facto even required... Recommends: kactivities5 # we want wallpaper previews