Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/kde:master commit in: kde-plasma/plasma-workspace/, kde-plasma/plasma-workspace/files/
Date: Sat, 31 Dec 2016 21:45:25
Message-Id: 1483220667.a1b323a6bb6a2d1a3d8e1fc4651bf81fe1f2cb0e.asturm@gentoo
1 commit: a1b323a6bb6a2d1a3d8e1fc4651bf81fe1f2cb0e
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Dec 31 21:44:27 2016 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 31 21:44:27 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=a1b323a6
7
8 kde-plasma/plasma-workspace: Drop backported patch
9
10 Upstream commit: e43b89e2b9f3ff9bf6299488e82a365cbfde2b2a
11
12 Package-Manager: portage-2.3.0
13
14 .../plasma-workspace-5.8.3-systray-cpuload.patch | 177 ---------------------
15 .../plasma-workspace-5.8.49.9999.ebuild | 1 -
16 2 files changed, 178 deletions(-)
17
18 diff --git a/kde-plasma/plasma-workspace/files/plasma-workspace-5.8.3-systray-cpuload.patch b/kde-plasma/plasma-workspace/files/plasma-workspace-5.8.3-systray-cpuload.patch
19 deleted file mode 100644
20 index fada327..0000000
21 --- a/kde-plasma/plasma-workspace/files/plasma-workspace-5.8.3-systray-cpuload.patch
22 +++ /dev/null
23 @@ -1,177 +0,0 @@
24 -From: Lindsay Roberts <m@××××××××.com>
25 -Date: Mon, 10 Oct 2016 16:55:49 +0000
26 -Subject: Systray: Move all icon resolution to dataengine
27 -X-Git-Url: http://quickgit.kde.org/?p=plasma-workspace.git&a=commitdiff&h=749f60b89f4a166833fb64a5b593a801f63f9615
28 ----
29 -Systray: Move all icon resolution to dataengine
30 -
31 -Summary:
32 -Changes triggered by investigation into a long-running high CPU usage bug with system tray animations. The systray itself had icon name to icon resolution code, which was being triggered (twice) for every icon, every time any icon in the systray was updated. This code was spinning up a KIconLoader on each of these instances, and throwing it directly away. Each one triggered a large quantity of memory allocations and disk scans.
33 -
34 -This patch moves the extra bit of "appName" logic from the native part of the system tray to the statusnotifieritem datasource, which already had a stored 'customIconLoader' to handle icon theme paths, and removes the special lookup from the sytemtray applet completely. It also prefers icons provided by the dataengine to doing another lookup (contentious?). This removes all the extra CPU usage outside of the QML scene graph and graphics drivers locally.
35 -
36 -This is very much a looking for feedback item - there are things about the icon loading paths I almost certainly haven't appreciated yet, and perhaps preferring loading by icon name in the applet has a another purpose.
37 -
38 -BUG: 356479
39 -
40 -Test Plan: Have tested locally with kgpg and steam, the two apps I have that trigger the old code path. In neither case, however, did the appName logic produce a different result to the code with just the icon search path in statusnotifieritem.
41 -
42 -Reviewers: #plasma, davidedmundson, mart
43 -
44 -Reviewed By: #plasma, davidedmundson, mart
45 -
46 -Subscribers: davidedmundson, plasma-devel
47 -
48 -Tags: #plasma
49 -
50 -Differential Revision: https://phabricator.kde.org/D2986
51 ----
52 -
53 -
54 ---- a/applets/systemtray/package/contents/ui/ConfigEntries.qml
55 -+++ b/applets/systemtray/package/contents/ui/ConfigEntries.qml
56 -@@ -75,7 +75,7 @@
57 - "index": i,
58 - "taskId": item.Id,
59 - "name": item.Title,
60 -- "iconName": plasmoid.nativeInterface.resolveIcon(item.IconName, item.IconThemePath),
61 -+ "iconName": item.IconName,
62 - "icon": item.Icon
63 - });
64 - }
65 -
66 ---- a/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml
67 -+++ b/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml
68 -@@ -28,7 +28,7 @@
69 - text: Title
70 - mainText: ToolTipTitle != "" ? ToolTipTitle : Title
71 - subText: ToolTipSubTitle
72 -- icon: ToolTipIcon != "" ? ToolTipIcon : plasmoid.nativeInterface.resolveIcon(IconName != "" ? IconName : Icon, IconThemePath)
73 -+ icon: ToolTipIcon != "" ? ToolTipIcon : Icon ? Icon : IconName
74 - textFormat: Text.AutoText
75 - category: Category
76 -
77 -@@ -48,7 +48,7 @@
78 -
79 - PlasmaCore.IconItem {
80 - id: iconItem
81 -- source: plasmoid.nativeInterface.resolveIcon(IconName != "" ? IconName : Icon, IconThemePath)
82 -+ source: Icon ? Icon : IconName
83 - width: Math.min(parent.width, parent.height)
84 - height: width
85 - active: taskIcon.containsMouse
86 -
87 ---- a/applets/systemtray/systemtray.cpp
88 -+++ b/applets/systemtray/systemtray.cpp
89 -@@ -37,36 +37,10 @@
90 - #include <Plasma/PluginLoader>
91 - #include <Plasma/ServiceJob>
92 -
93 --#include <KIconLoader>
94 --#include <KIconEngine>
95 - #include <KActionCollection>
96 - #include <KLocalizedString>
97 -
98 - #include <plasma_version.h>
99 --
100 --/*
101 -- * An app may also load icons from their own directories, so we need a new iconloader that takes this into account
102 -- * This is wrapped into a subclass of iconengine so the iconloader lifespan matches the icon object
103 -- */
104 --class AppIconEngine : public KIconEngine
105 --{
106 --public:
107 -- AppIconEngine(const QString &variant, const QString &path, const QString &appName);
108 -- ~AppIconEngine();
109 --private:
110 -- KIconLoader* m_loader;
111 --};
112 --
113 --AppIconEngine::AppIconEngine(const QString &variant, const QString &path, const QString &appName) :
114 -- KIconEngine(variant, m_loader = new KIconLoader(appName, QStringList()))
115 --{
116 -- m_loader->addAppDir(appName, path);
117 --}
118 --
119 --AppIconEngine::~AppIconEngine()
120 --{
121 -- delete m_loader;
122 --}
123 -
124 - class PlasmoidModel: public QStandardItemModel
125 - {
126 -@@ -167,32 +141,6 @@
127 - emit appletDeleted(applet);
128 - }
129 - }
130 --}
131 --
132 --QVariant SystemTray::resolveIcon(const QVariant &variant, const QString &iconThemePath)
133 --{
134 -- if (variant.canConvert<QString>()) {
135 -- if (!iconThemePath.isEmpty()) {
136 -- const QString path = iconThemePath;
137 -- if (!path.isEmpty()) {
138 -- // FIXME: If last part of path is not "icons", this won't work!
139 -- auto tokens = path.splitRef('/', QString::SkipEmptyParts);
140 -- if (tokens.length() >= 3 && tokens.takeLast() == QLatin1String("icons")) {
141 -- const QString appName = tokens.takeLast().toString();
142 --
143 -- return QVariant(QIcon(new AppIconEngine(variant.toString(), path, appName)));
144 -- } else {
145 -- qCWarning(SYSTEM_TRAY) << "Wrong IconThemePath" << path << ": too short or does not end with 'icons'";
146 -- }
147 -- }
148 --
149 -- //return just the string hoping that IconItem will know how to interpret it anyways as either a normal icon or a SVG from the theme
150 -- return variant;
151 -- }
152 -- }
153 --
154 -- // Most importantly QIcons. Nothing to do for those.
155 -- return variant;
156 - }
157 -
158 - void SystemTray::showPlasmoidMenu(QQuickItem *appletInterface, int x, int y)
159 -
160 ---- a/applets/systemtray/systemtray.h
161 -+++ b/applets/systemtray/systemtray.h
162 -@@ -59,12 +59,6 @@
163 - void cleanupTask(const QString &task);
164 -
165 - //Invokable utilities
166 -- /**
167 -- * returns either a simple icon name or a custom path if the app is
168 -- * using a custom theme
169 -- */
170 -- Q_INVOKABLE QVariant resolveIcon(const QVariant &variant, const QString &iconThemePath);
171 --
172 - /**
173 - * Given an AppletInterface pointer, shows a proper context menu for it
174 - */
175 -
176 ---- a/dataengines/statusnotifieritem/statusnotifieritemsource.cpp
177 -+++ b/dataengines/statusnotifieritem/statusnotifieritemsource.cpp
178 -@@ -240,14 +240,19 @@
179 - if (!m_customIconLoader) {
180 - m_customIconLoader = new KIconLoader(QString(), QStringList(), this);
181 - }
182 -+ // FIXME: If last part of path is not "icons", this won't work!
183 -+ QString appName;
184 -+ auto tokens = path.splitRef('/', QString::SkipEmptyParts);
185 -+ if (tokens.length() >= 3 && tokens.takeLast() == QLatin1String("icons"))
186 -+ appName = tokens.takeLast().toString();
187 -
188 - //icons may be either in the root directory of the passed path or in a appdir format
189 - //i.e hicolor/32x32/iconname.png
190 -
191 -- m_customIconLoader->reconfigure(QString(), QStringList(path));
192 -+ m_customIconLoader->reconfigure(appName, QStringList(path));
193 -
194 - //add app dir requires an app name, though this is completely unused in this context
195 -- m_customIconLoader->addAppDir(QStringLiteral("unused"), path);
196 -+ m_customIconLoader->addAppDir(appName.size() ? appName : QStringLiteral("unused"), path);
197 - }
198 - setData(QStringLiteral("IconThemePath"), path);
199 -
200 -
201
202 diff --git a/kde-plasma/plasma-workspace/plasma-workspace-5.8.49.9999.ebuild b/kde-plasma/plasma-workspace/plasma-workspace-5.8.49.9999.ebuild
203 index 845e63d..0e1932d 100644
204 --- a/kde-plasma/plasma-workspace/plasma-workspace-5.8.49.9999.ebuild
205 +++ b/kde-plasma/plasma-workspace/plasma-workspace-5.8.49.9999.ebuild
206 @@ -123,7 +123,6 @@ PATCHES=(
207 "${FILESDIR}/${PN}-5.4-startkde-script.patch"
208 # master
209 "${FILESDIR}/${PN}-5.7.90-baloo-optional.patch"
210 - "${FILESDIR}/${PN}-5.8.3-systray-cpuload.patch"
211 )
212
213 RESTRICT+=" test"