1 |
commit: 8dec78355342ff4b5d729c8b7be3fe70a8c00ca3 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat May 29 15:24:44 2021 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat May 29 21:16:19 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8dec7835 |
7 |
|
8 |
kde-frameworks/kglobalaccel: Backport 5.83 upstream revert |
9 |
|
10 |
Upstream commit 9a48818abf50340e31d718cc675501dec6c51429 |
11 |
|
12 |
KDE-bug: https://bugs.kde.org/show_bug.cgi?id=437034 |
13 |
Package-Manager: Portage-3.0.19, Repoman-3.0.3 |
14 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
15 |
|
16 |
...5.82.0-revert-prevent-activate-w-o-plasma.patch | 242 +++++++++++++++++++++ |
17 |
.../kglobalaccel/kglobalaccel-5.82.0-r1.ebuild | 39 ++++ |
18 |
2 files changed, 281 insertions(+) |
19 |
|
20 |
diff --git a/kde-frameworks/kglobalaccel/files/kglobalaccel-5.82.0-revert-prevent-activate-w-o-plasma.patch b/kde-frameworks/kglobalaccel/files/kglobalaccel-5.82.0-revert-prevent-activate-w-o-plasma.patch |
21 |
new file mode 100644 |
22 |
index 00000000000..1cea821ebe9 |
23 |
--- /dev/null |
24 |
+++ b/kde-frameworks/kglobalaccel/files/kglobalaccel-5.82.0-revert-prevent-activate-w-o-plasma.patch |
25 |
@@ -0,0 +1,242 @@ |
26 |
+From 9a48818abf50340e31d718cc675501dec6c51429 Mon Sep 17 00:00:00 2001 |
27 |
+From: Nate Graham <nate@×××.org> |
28 |
+Date: Wed, 26 May 2021 13:14:13 -0600 |
29 |
+Subject: [PATCH] Revert "Prevent kglobalaccel5 getting activated on non-Plasma |
30 |
+ systems" |
31 |
+ |
32 |
+This reverts commit 48c3376927e5e9c13377bf3cfc8b0c411783e7f3. |
33 |
+ |
34 |
+This change broke users of KGlobalAccel run outside of the Plasma |
35 |
+Desktop. This sort of behavior change probably needs to be made during |
36 |
+a major transition like KF6 so that developers have some notice and it |
37 |
+doesn't randomly change and break stuff unexpectedly. |
38 |
+ |
39 |
+CCBUG: 435420 |
40 |
+BUG: 437034 |
41 |
+FIXED-IN: 5.83 |
42 |
+--- |
43 |
+ src/kglobalaccel.cpp | 80 -------------------------------------------- |
44 |
+ 1 file changed, 80 deletions(-) |
45 |
+ |
46 |
+diff --git a/src/kglobalaccel.cpp b/src/kglobalaccel.cpp |
47 |
+index 8bb43e5..154caed 100644 |
48 |
+--- a/src/kglobalaccel.cpp |
49 |
++++ b/src/kglobalaccel.cpp |
50 |
+@@ -25,11 +25,6 @@ |
51 |
+ #include <QX11Info> |
52 |
+ #endif |
53 |
+ |
54 |
+-bool active() |
55 |
+-{ |
56 |
+- return qgetenv("XDG_CURRENT_DESKTOP") == QByteArrayLiteral("KDE"); |
57 |
+-} |
58 |
+- |
59 |
+ org::kde::kglobalaccel::Component *KGlobalAccelPrivate::getComponent(const QString &componentUnique, bool remember = false) |
60 |
+ { |
61 |
+ // Check if we already have this component |
62 |
+@@ -148,11 +143,6 @@ KGlobalAccel::~KGlobalAccel() |
63 |
+ void KGlobalAccel::activateGlobalShortcutContext(const QString &contextUnique, const QString &contextFriendly, const QString &programName) |
64 |
+ { |
65 |
+ Q_UNUSED(contextFriendly); |
66 |
+- |
67 |
+- if (!active()) { |
68 |
+- return; |
69 |
+- } |
70 |
+- |
71 |
+ // TODO: provide contextFriendly |
72 |
+ self()->d->iface()->activateGlobalShortcutContext(programName, contextUnique); |
73 |
+ } |
74 |
+@@ -160,10 +150,6 @@ void KGlobalAccel::activateGlobalShortcutContext(const QString &contextUnique, c |
75 |
+ // static |
76 |
+ bool KGlobalAccel::cleanComponent(const QString &componentUnique) |
77 |
+ { |
78 |
+- if (!active()) { |
79 |
+- return false; |
80 |
+- } |
81 |
+- |
82 |
+ org::kde::kglobalaccel::Component *component = self()->getComponent(componentUnique); |
83 |
+ if (!component) { |
84 |
+ return false; |
85 |
+@@ -175,10 +161,6 @@ bool KGlobalAccel::cleanComponent(const QString &componentUnique) |
86 |
+ // static |
87 |
+ bool KGlobalAccel::isComponentActive(const QString &componentUnique) |
88 |
+ { |
89 |
+- if (!active()) { |
90 |
+- return false; |
91 |
+- } |
92 |
+- |
93 |
+ org::kde::kglobalaccel::Component *component = self()->getComponent(componentUnique); |
94 |
+ if (!component) { |
95 |
+ return false; |
96 |
+@@ -196,10 +178,6 @@ bool KGlobalAccel::isEnabled() const |
97 |
+ |
98 |
+ org::kde::kglobalaccel::Component *KGlobalAccel::getComponent(const QString &componentUnique) |
99 |
+ { |
100 |
+- if (!active()) { |
101 |
+- return nullptr; |
102 |
+- } |
103 |
+- |
104 |
+ return d->getComponent(componentUnique); |
105 |
+ } |
106 |
+ |
107 |
+@@ -526,10 +504,6 @@ void KGlobalAccelPrivate::reRegisterAll() |
108 |
+ #if KGLOBALACCEL_BUILD_DEPRECATED_SINCE(4, 2) |
109 |
+ QList<QStringList> KGlobalAccel::allMainComponents() |
110 |
+ { |
111 |
+- if (!active()) { |
112 |
+- return {}; |
113 |
+- } |
114 |
+- |
115 |
+ return d->iface()->allMainComponents(); |
116 |
+ } |
117 |
+ #endif |
118 |
+@@ -537,9 +511,6 @@ QList<QStringList> KGlobalAccel::allMainComponents() |
119 |
+ #if KGLOBALACCEL_BUILD_DEPRECATED_SINCE(4, 2) |
120 |
+ QList<QStringList> KGlobalAccel::allActionsForComponent(const QStringList &actionId) |
121 |
+ { |
122 |
+- if (!active()) { |
123 |
+- return {}; |
124 |
+- } |
125 |
+ return d->iface()->allActionsForComponent(actionId); |
126 |
+ } |
127 |
+ #endif |
128 |
+@@ -548,29 +519,17 @@ QList<QStringList> KGlobalAccel::allActionsForComponent(const QStringList &actio |
129 |
+ #if KGLOBALACCEL_BUILD_DEPRECATED_SINCE(4, 2) |
130 |
+ QStringList KGlobalAccel::findActionNameSystemwide(const QKeySequence &seq) |
131 |
+ { |
132 |
+- if (!active()) { |
133 |
+- return {}; |
134 |
+- } |
135 |
+- |
136 |
+ return self()->d->iface()->action(seq[0]); |
137 |
+ } |
138 |
+ #endif |
139 |
+ |
140 |
+ QList<KGlobalShortcutInfo> KGlobalAccel::getGlobalShortcutsByKey(const QKeySequence &seq) |
141 |
+ { |
142 |
+- if (!active()) { |
143 |
+- return {}; |
144 |
+- } |
145 |
+- |
146 |
+ return self()->d->iface()->getGlobalShortcutsByKey(seq[0]); |
147 |
+ } |
148 |
+ |
149 |
+ bool KGlobalAccel::isGlobalShortcutAvailable(const QKeySequence &seq, const QString &comp) |
150 |
+ { |
151 |
+- if (!active()) { |
152 |
+- return false; |
153 |
+- } |
154 |
+- |
155 |
+ return self()->d->iface()->isGlobalShortcutAvailable(seq[0], comp); |
156 |
+ } |
157 |
+ |
158 |
+@@ -578,10 +537,6 @@ bool KGlobalAccel::isGlobalShortcutAvailable(const QKeySequence &seq, const QStr |
159 |
+ #if KGLOBALACCEL_BUILD_DEPRECATED_SINCE(4, 2) |
160 |
+ bool KGlobalAccel::promptStealShortcutSystemwide(QWidget *parent, const QStringList &actionIdentifier, const QKeySequence &seq) |
161 |
+ { |
162 |
+- if (!active()) { |
163 |
+- return false; |
164 |
+- } |
165 |
+- |
166 |
+ if (actionIdentifier.size() < 4) { |
167 |
+ return false; |
168 |
+ } |
169 |
+@@ -604,10 +559,6 @@ bool KGlobalAccel::promptStealShortcutSystemwide(QWidget *parent, const QStringL |
170 |
+ // static |
171 |
+ bool KGlobalAccel::promptStealShortcutSystemwide(QWidget *parent, const QList<KGlobalShortcutInfo> &shortcuts, const QKeySequence &seq) |
172 |
+ { |
173 |
+- if (!active()) { |
174 |
+- return false; |
175 |
+- } |
176 |
+- |
177 |
+ if (shortcuts.isEmpty()) { |
178 |
+ // Usage error. Just say no |
179 |
+ return false; |
180 |
+@@ -640,10 +591,6 @@ bool KGlobalAccel::promptStealShortcutSystemwide(QWidget *parent, const QList<KG |
181 |
+ // static |
182 |
+ void KGlobalAccel::stealShortcutSystemwide(const QKeySequence &seq) |
183 |
+ { |
184 |
+- if (!active()) { |
185 |
+- return; |
186 |
+- } |
187 |
+- |
188 |
+ // get the shortcut, remove seq, and set the new shortcut |
189 |
+ const QStringList actionId = self()->d->iface()->action(seq[0]); |
190 |
+ if (actionId.size() < 4) { // not a global shortcut |
191 |
+@@ -676,10 +623,6 @@ bool checkGarbageKeycode(const QList<QKeySequence> &shortcut) |
192 |
+ |
193 |
+ bool KGlobalAccel::setDefaultShortcut(QAction *action, const QList<QKeySequence> &shortcut, GlobalShortcutLoading loadFlag) |
194 |
+ { |
195 |
+- if (!active()) { |
196 |
+- return false; |
197 |
+- } |
198 |
+- |
199 |
+ if (checkGarbageKeycode(shortcut)) { |
200 |
+ return false; |
201 |
+ } |
202 |
+@@ -695,10 +638,6 @@ bool KGlobalAccel::setDefaultShortcut(QAction *action, const QList<QKeySequence> |
203 |
+ |
204 |
+ bool KGlobalAccel::setShortcut(QAction *action, const QList<QKeySequence> &shortcut, GlobalShortcutLoading loadFlag) |
205 |
+ { |
206 |
+- if (!active()) { |
207 |
+- return false; |
208 |
+- } |
209 |
+- |
210 |
+ if (checkGarbageKeycode(shortcut)) { |
211 |
+ return false; |
212 |
+ } |
213 |
+@@ -724,9 +663,6 @@ QList<QKeySequence> KGlobalAccel::shortcut(const QAction *action) const |
214 |
+ |
215 |
+ QList<QKeySequence> KGlobalAccel::globalShortcut(const QString &componentName, const QString &actionId) const |
216 |
+ { |
217 |
+- if (!active()) { |
218 |
+- return {}; |
219 |
+- } |
220 |
+ // see also d->updateGlobalShortcut(action, KGlobalAccelPrivate::ActiveShortcut, KGlobalAccel::Autoloading); |
221 |
+ |
222 |
+ // how componentName and actionId map to QAction, e.g: |
223 |
+@@ -740,19 +676,11 @@ QList<QKeySequence> KGlobalAccel::globalShortcut(const QString &componentName, c |
224 |
+ |
225 |
+ void KGlobalAccel::removeAllShortcuts(QAction *action) |
226 |
+ { |
227 |
+- if (!active()) { |
228 |
+- return; |
229 |
+- } |
230 |
+- |
231 |
+ d->remove(action, KGlobalAccelPrivate::UnRegister); |
232 |
+ } |
233 |
+ |
234 |
+ bool KGlobalAccel::hasShortcut(const QAction *action) const |
235 |
+ { |
236 |
+- if (!active()) { |
237 |
+- return false; |
238 |
+- } |
239 |
+- |
240 |
+ return d->actionShortcuts.contains(action) || d->actionDefaultShortcuts.contains(action); |
241 |
+ } |
242 |
+ |
243 |
+@@ -765,10 +693,6 @@ bool KGlobalAccel::eventFilter(QObject *watched, QEvent *event) |
244 |
+ |
245 |
+ bool KGlobalAccel::setGlobalShortcut(QAction *action, const QList<QKeySequence> &shortcut) |
246 |
+ { |
247 |
+- if (!active()) { |
248 |
+- return false; |
249 |
+- } |
250 |
+- |
251 |
+ KGlobalAccel *g = KGlobalAccel::self(); |
252 |
+ return g->d->setShortcutWithDefault(action, shortcut, Autoloading); |
253 |
+ } |
254 |
+@@ -780,10 +704,6 @@ bool KGlobalAccel::setGlobalShortcut(QAction *action, const QKeySequence &shortc |
255 |
+ |
256 |
+ bool KGlobalAccelPrivate::setShortcutWithDefault(QAction *action, const QList<QKeySequence> &shortcut, KGlobalAccel::GlobalShortcutLoading loadFlag) |
257 |
+ { |
258 |
+- if (!active()) { |
259 |
+- return false; |
260 |
+- } |
261 |
+- |
262 |
+ if (checkGarbageKeycode(shortcut)) { |
263 |
+ return false; |
264 |
+ } |
265 |
+-- |
266 |
+GitLab |
267 |
+ |
268 |
|
269 |
diff --git a/kde-frameworks/kglobalaccel/kglobalaccel-5.82.0-r1.ebuild b/kde-frameworks/kglobalaccel/kglobalaccel-5.82.0-r1.ebuild |
270 |
new file mode 100644 |
271 |
index 00000000000..a8a3e30dd7e |
272 |
--- /dev/null |
273 |
+++ b/kde-frameworks/kglobalaccel/kglobalaccel-5.82.0-r1.ebuild |
274 |
@@ -0,0 +1,39 @@ |
275 |
+# Copyright 1999-2021 Gentoo Authors |
276 |
+# Distributed under the terms of the GNU General Public License v2 |
277 |
+ |
278 |
+EAPI=7 |
279 |
+ |
280 |
+PVCUT=$(ver_cut 1-2) |
281 |
+QTMIN=5.15.2 |
282 |
+VIRTUALX_REQUIRED="test" |
283 |
+inherit ecm kde.org |
284 |
+ |
285 |
+DESCRIPTION="Framework to handle global shortcuts" |
286 |
+ |
287 |
+LICENSE="LGPL-2+" |
288 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" |
289 |
+IUSE="nls" |
290 |
+ |
291 |
+DEPEND=" |
292 |
+ >=dev-qt/qtdbus-${QTMIN}:5 |
293 |
+ >=dev-qt/qtgui-${QTMIN}:5 |
294 |
+ >=dev-qt/qtwidgets-${QTMIN}:5 |
295 |
+ >=dev-qt/qtx11extras-${QTMIN}:5 |
296 |
+ =kde-frameworks/kconfig-${PVCUT}*:5 |
297 |
+ =kde-frameworks/kcoreaddons-${PVCUT}*:5 |
298 |
+ =kde-frameworks/kcrash-${PVCUT}*:5 |
299 |
+ =kde-frameworks/kdbusaddons-${PVCUT}*:5 |
300 |
+ =kde-frameworks/kwindowsystem-${PVCUT}*:5[X] |
301 |
+ x11-libs/libxcb |
302 |
+ x11-libs/xcb-util-keysyms |
303 |
+" |
304 |
+RDEPEND="${DEPEND}" |
305 |
+BDEPEND="nls? ( >=dev-qt/linguist-tools-${QTMIN}:5 )" |
306 |
+ |
307 |
+PATCHES=( |
308 |
+ "${FILESDIR}"/${P}-revert-prevent-activate-w-o-plasma.patch # KDE-bug 437034 |
309 |
+) |
310 |
+ |
311 |
+src_test() { |
312 |
+ XDG_CURRENT_DESKTOP="KDE" ecm_src_test # bug 789342 |
313 |
+} |