Ana Guerrero 2024-06-22 11:22:45 +00:00 committed by Git OBS Bridge
commit fc33b585b6
7 changed files with 102 additions and 26 deletions

View File

@ -0,0 +1,51 @@
From 0641dee0947355d4a242364628079a2ae7e042b7 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fabian@ritter-vogt.de>
Date: Fri, 21 Jun 2024 20:43:57 +0200
Subject: [PATCH] runner: Don't match if just one query word matches
If someone types in "foo asdf start bar", it should not show the autostart
KCM for instance.
This runner is part of the default favorites in Plasma 6.1, so it's
shown above others and must avoid polluting results.
BUG: 488676
---
runner/systemsettingsrunner.cpp | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/runner/systemsettingsrunner.cpp b/runner/systemsettingsrunner.cpp
index 826194f9..d33b7906 100644
--- a/runner/systemsettingsrunner.cpp
+++ b/runner/systemsettingsrunner.cpp
@@ -51,12 +51,12 @@ void SystemsettingsRunner::match(KRunner::RunnerContext &context)
return true;
}
for (const QString &queryWord : queryWords) {
- if (relevance == -1 && queryWord.length() > 3 && value.contains(queryWord, Qt::CaseInsensitive)) {
- relevance = relevanceValue;
- return true;
+ if (!value.contains(queryWord, Qt::CaseInsensitive)) {
+ return false;
}
}
- return false;
+ relevance = relevanceValue;
+ return true;
};
const QString name = data.name();
@@ -71,8 +71,8 @@ void SystemsettingsRunner::match(KRunner::RunnerContext &context)
}
} else if (name.compare(query, Qt::CaseInsensitive) == 0) {
relevance = 1;
- } else if (checkMatchAndRelevance(name, 0.8)) { // name starts with query or contains any query word
- } else if (checkMatchAndRelevance(description, 0.5)) { // description starts with query or contains any query word
+ } else if (checkMatchAndRelevance(name, 0.8)) { // name starts with query or contains all query words
+ } else if (checkMatchAndRelevance(description, 0.5)) { // description starts with query or contains all query words
} else if (std::any_of(keywords.begin(), keywords.end(), [&query](const QString &keyword) {
return keyword.startsWith(query, Qt::CaseInsensitive);
})) {
--
2.45.2

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b722ba21fabd8cd27e2371a83e33a9a4e1403257d454b3f01c6fa46c2874cf93
size 219620

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE4KPrIC+OV1KOE+cv11dEg7tXsY0FAmZM0QkACgkQ11dEg7tX
sY28Hg//TtG1N/fIO9lQRwUBC+jHEvfKthOVyAhc1+g4+s1wIL31V0myoCk7E0FC
yMCe9cBuSYQb1GNwtGWD6jPKciYRY9DikuYCk3Cci85MOSO0ZSOlYI8leORP+SbD
kG+YZkDM58jAjzywru8Dw8+oZKpVJdW1FJesWKkx4Q0G01b5PxVZSWybQV1/nb1d
uQR3Cj1/Nj1/ikaFz4Jbj22NZHlG7/EWXS15t3dsuUiuhThniWRyTS55h5QruiXI
ZcWscJvoyAYPzIeuu+3Ka8RjQ36XnQfWdy3KQonGjl40JYvPvhOKk0/64wYJiE3o
0MDGgrKNGtXW1+XNbsA1Vv8CXqlckVdVtFZ8xitzchcfcG7v9aF1x1uou0RiAiWj
SH6tb9X/GqlMtKq6/EKfzQIgbfBnYTxbEgXeICUrzeCHpJPQu2mXcum/G00UyPGO
jWlkqtqF5dTLOCzlxWx4Hzi1NDIWvub3fd7yANQ5RfTJePjj7OUJ4/R201D5D0+6
8GW5n8pMok0JJf7I+VLBhylDR5wDmRTDK1R/btCEbVkR2xRrNzJ7d7LugO9wSV3g
u0UIOq79Rf3nQRUgvwlwIOa2GYM3wb0jvRhVkWNEBzKgYrh57wl1l6AyDM/6Vhak
caVRJt1uYllDpXFEDpFi8ch/jaRk8NahfiZ+fd+vyEnx/S/djmw=
=poZM
-----END PGP SIGNATURE-----

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bd94b1342064794a142cb285ed102a6db6959bf2682d4e661d560d734a68ca5c
size 214416

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE4KPrIC+OV1KOE+cv11dEg7tXsY0FAmZqzA8ACgkQ11dEg7tX
sY0VFw/9HzeanyLqE2Vkv2zdEaAr/6/qtmNOtJW4OnmWn7aE4/3VdGjgkSRPnSKF
ax+CamVd8VbvHXVQIWWQ4mgX3JTiW4pBsMUpSZ8cK3deZnnJfQ6AEPiMaPdkx00e
jknp7yxTj6wnwaihtTzi981bcMX59X/ILt29x2eJFe5pCsKvg/60CdrnF57cAjQc
dDY7hwCROUYvuxNneeEJixH6AaGOlTWrWAO4goXmuy2ZuVDMHpCAj3HX0ql54WAA
CD/zmrOkrGLWYnH1Nm3h9VsplKehsGAPxsYk6NK5rEjEsUZ4RGTHiyjCDfkwVnLb
2Js+yX9KLwfezydOxz6Y5RaHQO0ERVxXL+VNaX0TX8ie36XgdCBMsh3p3VrQ/pmg
oa4bZrZdmRO2yomNp4/f7dW6QQpvWvWbXnxjqrc5Qfd58eLlAmCtCAkYkUVNUMkb
gzFsNIgH0IAFTBYH/7n3dVE61DCzW4s8UQLUk4YmQqdWx2StGFyncdDSPRCnL54F
Gmqfo0+P5OoHw0T/dQb6ZGiphtTKVpTpjFubEiyOqeBdAYeIzecRPKPbMPqEKMB3
J4kciV8PNRLlxAC2LlaR+1Vag84mmwxz/e/TZ6Ztg2r+wk6sR4d0arSO6bYoxTfB
dBvHg39ao65uLicN7Jo96t6mf//Gn7bEvVsGd0L9EKxIhh7kgo8=
=X7d5
-----END PGP SIGNATURE-----

View File

@ -1,3 +1,29 @@
-------------------------------------------------------------------
Fri Jun 21 18:46:45 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Add patch to avoid krunner result pollution (kde#488676):
* 0001-runner-Don-t-match-if-just-one-query-word-matches.patch
-------------------------------------------------------------------
Thu Jun 13 10:59:02 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.1.0:
* New bugfix release
* For more details see https://kde.org/announcements/plasma/6/6.1.0
- Changes since 6.0.90:
* update version for new release
* appstream versions
* update version for new release
* join keywords lists using ZERO WIDTH SPACE instead of empty string (kde#487855)
-------------------------------------------------------------------
Sat May 25 11:20:17 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>
- Update to 6.0.90:
* New feature release
* For more details see https://kde.org/announcements/plasma/6/6.0.90
- Too many changes to list here
-------------------------------------------------------------------
Wed May 22 07:43:23 UTC 2024 - Fabian Vogt <fabian@ritter-vogt.de>

View File

@ -18,7 +18,7 @@
%global __requires_exclude qt6qmlimport\\(org\\.kde\\.systemsettings.*
%define kf6_version 6.0.0
%define kf6_version 6.2.0
%define qt6_version 6.6.0
%define rname systemsettings
@ -28,16 +28,18 @@
%{!?_plasma6_version: %define _plasma6_version %(echo %{_plasma6_bugfix} | awk -F. '{print $1"."$2}')}
%bcond_without released
Name: systemsettings6
Version: 6.0.5
Version: 6.1.0
Release: 0
Summary: KDE's control center
License: GPL-2.0-or-later
URL: https://www.kde.org/
Source: https://download.kde.org/stable/plasma/%{version}/%{rname}-%{version}.tar.xz
Source: %{rname}-%{version}.tar.xz
%if %{with released}
Source1: https://download.kde.org/stable/plasma/%{version}/%{rname}-%{version}.tar.xz.sig
Source1: %{rname}-%{version}.tar.xz.sig
Source2: plasma.keyring
%endif
# PATCH-FIX-UPSTREAM
Patch1: 0001-runner-Don-t-match-if-just-one-query-word-matches.patch
BuildRequires: kf6-extra-cmake-modules >= %{kf6_version}
BuildRequires: update-desktop-files
BuildRequires: cmake(KF6Auth) >= %{kf6_version}
@ -90,8 +92,6 @@ applications by KDE.
%suse_update_desktop_file kdesystemsettings X-SuSE-core
%ldconfig_scriptlets
%files
%license LICENSES/*
%doc %lang(en) %{_kf6_htmldir}/en/systemsettings/
@ -103,7 +103,6 @@ applications by KDE.
%{_kf6_appstreamdir}/org.kde.systemsettings.metainfo.xml
%{_kf6_bindir}/systemsettings
%{_kf6_debugdir}/systemsettings.categories
%{_kf6_libdir}/libsystemsettingsview.so.3
%dir %{_kf6_plugindir}/kf6/krunner
%{_kf6_plugindir}/kf6/krunner/krunner_systemsettings.so
%{_kf6_sharedir}/kglobalaccel/systemsettings.desktop