Accepting request 899482 from KDE:Frameworks5
OBS-URL: https://build.opensuse.org/request/show/899482 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/plasma5-workspace?expand=0&rev=167
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
From c00d380ebe58d6c4c1765e33264d787f8ccef126 Mon Sep 17 00:00:00 2001
|
||||
From: David Redondo <kde@david-redondo.de>
|
||||
Date: Fri, 11 Jun 2021 09:40:21 +0200
|
||||
Subject: [PATCH] krunerglobalshortcuts: Fix migration from old component
|
||||
|
||||
When calling cleanUpComponent KGlobalAccel checks if there are no
|
||||
shortcuts active, otherwise it will refuse to clean the component.
|
||||
For a desktop file component (aka KServiceActionComponent) all
|
||||
shortcuts are deactivated inside cleanUpComponent. For a regular
|
||||
Component we have to do this manually.
|
||||
---
|
||||
krunner/update/krunnerglobalshortcuts.cpp | 22 +++++++++++++++-------
|
||||
1 file changed, 15 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/krunner/update/krunnerglobalshortcuts.cpp b/krunner/update/krunnerglobalshortcuts.cpp
|
||||
index af9ffbe1f..618502e34 100644
|
||||
--- a/krunner/update/krunnerglobalshortcuts.cpp
|
||||
+++ b/krunner/update/krunnerglobalshortcuts.cpp
|
||||
@@ -58,16 +58,24 @@ int main(int argc, char **argv)
|
||||
|
||||
QList<QKeySequence> oldRunCommand;
|
||||
QList<QKeySequence> oldRunClipboard;
|
||||
- if (KGlobalAccel::isComponentActive(oldCompomentName)) {
|
||||
- oldRunCommand = KGlobalAccel::self()->globalShortcut(oldCompomentName, QStringLiteral("run command"));
|
||||
- oldRunClipboard = KGlobalAccel::self()->globalShortcut(oldCompomentName, QStringLiteral("run command on clipboard contents"));
|
||||
- KGlobalAccel::self()->cleanComponent(oldCompomentName);
|
||||
- } else if (KGlobalAccel::isComponentActive(oldDesktopFile)) {
|
||||
+
|
||||
+ // It can happen that the old component is not active so we do it unconditionally
|
||||
+ KActionCollection oldActions(nullptr, oldCompomentName);
|
||||
+ QAction oldRunCommandAction, oldRunClipboardAction;
|
||||
+ oldActions.addAction(QStringLiteral("run command"), &oldRunCommandAction);
|
||||
+ oldActions.addAction(QStringLiteral("run command on clipboard contents"), &oldRunClipboardAction);
|
||||
+ oldRunCommand = KGlobalAccel::self()->globalShortcut(oldCompomentName, oldRunCommandAction.objectName());
|
||||
+ oldRunClipboard = KGlobalAccel::self()->globalShortcut(oldCompomentName, oldRunClipboardAction.objectName());
|
||||
+ KGlobalAccel::self()->setShortcut(&oldRunCommandAction, {});
|
||||
+ KGlobalAccel::self()->setShortcut(&oldRunClipboardAction, {});
|
||||
+ KGlobalAccel::self()->removeAllShortcuts(&oldRunCommandAction);
|
||||
+ KGlobalAccel::self()->removeAllShortcuts(&oldRunClipboardAction);
|
||||
+ KGlobalAccel::self()->cleanComponent(oldCompomentName);
|
||||
+
|
||||
+ if (KGlobalAccel::isComponentActive(oldDesktopFile)) {
|
||||
oldRunCommand = KGlobalAccel::self()->globalShortcut(oldDesktopFile, runCommandAction->objectName());
|
||||
oldRunClipboard = KGlobalAccel::self()->globalShortcut(oldDesktopFile, runClipboardAction->objectName());
|
||||
KGlobalAccel::self()->cleanComponent(oldDesktopFile);
|
||||
- } else {
|
||||
- return 0;
|
||||
}
|
||||
|
||||
shortCutActions.takeAction(runCommandAction);
|
||||
--
|
||||
2.25.1
|
||||
|
@@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Jun 11 09:51:33 UTC 2021 - Fabian Vogt <fabian@ritter-vogt.de>
|
||||
|
||||
- Add another patch to fix migration of krunner shortcuts from
|
||||
Plasma < 5.17 (boo#1187204):
|
||||
* 0001-krunerglobalshortcuts-Fix-migration-from-old-compone.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 9 12:00:42 UTC 2021 - Fabian Vogt <fabian@ritter-vogt.de>
|
||||
|
||||
|
@@ -45,6 +45,7 @@ Source3: baselibs.conf
|
||||
# PATCH-FIX-UPSTREAM
|
||||
Patch1: 0001-Fix-kcmfontinst-install-destination.patch
|
||||
Patch2: 0001-krunnerglobalshortcuts-Prevent-actions-from-becoming.patch
|
||||
Patch3: 0001-krunerglobalshortcuts-Fix-migration-from-old-compone.patch
|
||||
# PATCHES 501-??? are PATCH-FIX-OPENSUSE
|
||||
Patch501: 0001-Use-qdbus-qt5.patch
|
||||
Patch502: 0001-Ignore-default-sddm-face-icons.patch
|
||||
|
Reference in New Issue
Block a user