1 |
commit: 547bdf84d94ecfcca5aa09cc2ebd6d1e8fc455ac |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jan 30 17:03:40 2019 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 30 17:03:40 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=547bdf84 |
7 |
|
8 |
kde-frameworks/kxmlgui: Fix Qt5 app artifacts w/ kcheckaccelerators |
9 |
|
10 |
Fixes long-standing bug in applications under Plasma-5 not linking to KXmlGui, |
11 |
as seen in QtCreator and Clementine e.g. |
12 |
|
13 |
KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=337491 |
14 |
Package-Manager: Portage-2.3.59, Repoman-2.3.12 |
15 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
16 |
|
17 |
.../files/kxmlgui-5.54.0-kcheckaccelerators.patch | 79 ++++++++++++++++++++++ |
18 |
kde-frameworks/kxmlgui/kxmlgui-5.54.0-r1.ebuild | 54 +++++++++++++++ |
19 |
2 files changed, 133 insertions(+) |
20 |
|
21 |
diff --git a/kde-frameworks/kxmlgui/files/kxmlgui-5.54.0-kcheckaccelerators.patch b/kde-frameworks/kxmlgui/files/kxmlgui-5.54.0-kcheckaccelerators.patch |
22 |
new file mode 100644 |
23 |
index 00000000000..0882d5f09f9 |
24 |
--- /dev/null |
25 |
+++ b/kde-frameworks/kxmlgui/files/kxmlgui-5.54.0-kcheckaccelerators.patch |
26 |
@@ -0,0 +1,79 @@ |
27 |
+From 02b523bad09aab062355e46771889b0f3709692f Mon Sep 17 00:00:00 2001 |
28 |
+From: Albert Astals Cid <aacid@×××.org> |
29 |
+Date: Sat, 12 Jan 2019 18:39:33 +0100 |
30 |
+Subject: Make KCheckAccelerators less invasive for apps that don't directly |
31 |
+ link to KXmlGui |
32 |
+ |
33 |
+Summary: BUGS: 337491 |
34 |
+ |
35 |
+Test Plan: |
36 |
+Ran qtcreator and it no longer has the & in Details |
37 |
+Added some debug and checked that okular still gets the code called |
38 |
+ |
39 |
+Reviewers: anthonyfieroni |
40 |
+ |
41 |
+Reviewed By: anthonyfieroni |
42 |
+ |
43 |
+Subscribers: davidedmundson, anthonyfieroni, kde-frameworks-devel |
44 |
+ |
45 |
+Tags: #frameworks |
46 |
+ |
47 |
+Differential Revision: https://phabricator.kde.org/D18204 |
48 |
+--- |
49 |
+ src/kcheckaccelerators.cpp | 38 ++++++++++++++++++++++++++++++++++++-- |
50 |
+ 1 file changed, 36 insertions(+), 2 deletions(-) |
51 |
+ |
52 |
+diff --git a/src/kcheckaccelerators.cpp b/src/kcheckaccelerators.cpp |
53 |
+index 13fc012..e08447d 100644 |
54 |
+--- a/src/kcheckaccelerators.cpp |
55 |
++++ b/src/kcheckaccelerators.cpp |
56 |
+@@ -80,10 +80,44 @@ public Q_SLOTS: |
57 |
+ |
58 |
+ static void startupFunc() |
59 |
+ { |
60 |
+- // Call initiateIfNeeded once we're in the event loop |
61 |
+- // This is to prevent using KSharedConfig before main() can set the app name |
62 |
++ // Static because in some cases this is called multiple times |
63 |
++ // but if an application had any of the bad cases we always want |
64 |
++ // to skip the check |
65 |
++ static bool doCheckAccelerators = true; |
66 |
++ |
67 |
++ if (!doCheckAccelerators) { |
68 |
++ return; |
69 |
++ } |
70 |
++ |
71 |
+ QCoreApplication *app = QCoreApplication::instance(); |
72 |
++ if (!app) { |
73 |
++ // We're being loaded by something that doesn't have a QCoreApplication |
74 |
++ // this would probably crash at some later point since we do use qApp-> |
75 |
++ // quite a lot, so skip the magic |
76 |
++ doCheckAccelerators = false; |
77 |
++ return; |
78 |
++ } |
79 |
++ |
80 |
++ if (!QCoreApplication::startingUp()) { |
81 |
++ // If the app has already started, this means we're not being run as part of |
82 |
++ // qt_call_pre_routines, which most probably means that we're being run as part |
83 |
++ // of KXmlGui being loaded as part of some plugin of the app, so don't |
84 |
++ // do any magic |
85 |
++ doCheckAccelerators = false; |
86 |
++ return; |
87 |
++ } |
88 |
++ |
89 |
++ if (!QCoreApplication::eventDispatcher()) { |
90 |
++ // We are called with event dispatcher being null when KXmlGui is being loaded |
91 |
++ // through plasma-integration instead of being linked to the app (i.e. QtCreator vs Okular) |
92 |
++ // For apps that don't link directly to KXmlGui do not do the accelerator magic |
93 |
++ doCheckAccelerators = false; |
94 |
++ return; |
95 |
++ } |
96 |
++ |
97 |
+ KCheckAcceleratorsInitializer *initializer = new KCheckAcceleratorsInitializer(app); |
98 |
++ // Call initiateIfNeeded once we're in the event loop |
99 |
++ // This is to prevent using KSharedConfig before main() can set the app name |
100 |
+ QMetaObject::invokeMethod(initializer, "initiateIfNeeded", Qt::QueuedConnection); |
101 |
+ } |
102 |
+ |
103 |
+-- |
104 |
+cgit v1.1 |
105 |
+ |
106 |
|
107 |
diff --git a/kde-frameworks/kxmlgui/kxmlgui-5.54.0-r1.ebuild b/kde-frameworks/kxmlgui/kxmlgui-5.54.0-r1.ebuild |
108 |
new file mode 100644 |
109 |
index 00000000000..eac5c3cc9e2 |
110 |
--- /dev/null |
111 |
+++ b/kde-frameworks/kxmlgui/kxmlgui-5.54.0-r1.ebuild |
112 |
@@ -0,0 +1,54 @@ |
113 |
+# Copyright 1999-2019 Gentoo Authors |
114 |
+# Distributed under the terms of the GNU General Public License v2 |
115 |
+ |
116 |
+EAPI=6 |
117 |
+ |
118 |
+VIRTUALX_REQUIRED="test" |
119 |
+inherit kde5 |
120 |
+ |
121 |
+DESCRIPTION="Framework for managing menu and toolbar actions in an abstract way" |
122 |
+KEYWORDS="~amd64 ~arm ~arm64 ~x86" |
123 |
+LICENSE="LGPL-2+" |
124 |
+IUSE="attica" |
125 |
+ |
126 |
+# slot op: includes QtCore/private/qlocale_p.h |
127 |
+RDEPEND=" |
128 |
+ $(add_frameworks_dep kconfig) |
129 |
+ $(add_frameworks_dep kconfigwidgets) |
130 |
+ $(add_frameworks_dep kcoreaddons) |
131 |
+ $(add_frameworks_dep kglobalaccel) |
132 |
+ $(add_frameworks_dep ki18n) |
133 |
+ $(add_frameworks_dep kiconthemes) |
134 |
+ $(add_frameworks_dep kitemviews) |
135 |
+ $(add_frameworks_dep ktextwidgets) |
136 |
+ $(add_frameworks_dep kwidgetsaddons) |
137 |
+ $(add_frameworks_dep kwindowsystem) |
138 |
+ $(add_qt_dep qtcore '' '' '5=') |
139 |
+ $(add_qt_dep qtdbus) |
140 |
+ $(add_qt_dep qtgui) |
141 |
+ $(add_qt_dep qtnetwork 'ssl') |
142 |
+ $(add_qt_dep qtprintsupport) |
143 |
+ $(add_qt_dep qtwidgets) |
144 |
+ $(add_qt_dep qtxml) |
145 |
+ attica? ( $(add_frameworks_dep attica) ) |
146 |
+" |
147 |
+DEPEND="${RDEPEND}" |
148 |
+ |
149 |
+PATCHES=( "${FILESDIR}/${P}-kcheckaccelerators.patch" ) |
150 |
+ |
151 |
+src_configure() { |
152 |
+ local mycmakeargs=( |
153 |
+ $(cmake-utils_use_find_package attica KF5Attica) |
154 |
+ ) |
155 |
+ |
156 |
+ kde5_src_configure |
157 |
+} |
158 |
+ |
159 |
+src_test() { |
160 |
+ # Files are missing; whatever. Bugs 650290, 668198 |
161 |
+ local myctestargs=( |
162 |
+ -E "(ktoolbar_unittest|kxmlgui_unittest)" |
163 |
+ ) |
164 |
+ |
165 |
+ kde5_src_test |
166 |
+} |