pull in 5.8 branch fixes

epel9
Rex Dieter 8 years ago
parent e7ffebcc4f
commit 19c5cab7b3

7
.gitignore vendored

@ -1,3 +1,10 @@
/plasma-workspace-5.8.3.tar.xz /plasma-workspace-5.8.3.tar.xz
/plasma-workspace-5.8.4.tar.xz /plasma-workspace-5.8.4.tar.xz
/plasma-workspace-5.8.5.tar.xz /plasma-workspace-5.8.5.tar.xz
/0001-use-a-native-event-filter-to-notice-the-screen-was-s.patch
/0002-Systray-Move-all-icon-resolution-to-dataengine.patch
/0003-MPRIS-Data-Engine-Don-t-crash-if-Metadata-is-a-map-b.patch
/0004-Fix-Pinned-Chrome-disappears-when-all-Chrome-windows.patch
/0005-better-clean-up-of-duplicate-containments.patch
/0006-MediaController-Update-position-while-queuedPosition.patch
/0007-Corona-screenGeometryChanged-on-qscreen-resized.patch

@ -1,409 +0,0 @@
From d1708e3011969823e67869b8a1c639f15b6fd73a Mon Sep 17 00:00:00 2001
From: Aleix Pol <aleixpol@kde.org>
Date: Mon, 10 Oct 2016 16:30:24 +0200
Subject: [PATCH 31/59] Port to new plasma-framework API
Reduces unnecessary castings.
Ports away the WindowedWidgets runner from KService
REVIEW: 129101
---
applets/systemtray/systemtray.cpp | 30 +++++++-------
.../shellprivate/widgetexplorer/widgetexplorer.cpp | 14 +++----
plasma-windowed/plasmawindowedcorona.cpp | 2 +-
runners/windowedwidgets/windowedwidgetsrunner.cpp | 46 ++++++++++------------
runners/windowedwidgets/windowedwidgetsrunner.h | 2 +-
shell/alternativeshelper.cpp | 6 +--
shell/containmentconfigview.cpp | 2 +-
shell/scripting/containment.cpp | 4 +-
shell/scripting/widget.cpp | 2 +-
shell/shellcorona.cpp | 15 +++----
10 files changed, 60 insertions(+), 63 deletions(-)
diff --git a/applets/systemtray/systemtray.cpp b/applets/systemtray/systemtray.cpp
index e1cd610..ecc23a4 100644
--- a/applets/systemtray/systemtray.cpp
+++ b/applets/systemtray/systemtray.cpp
@@ -99,19 +99,19 @@ void SystemTray::init()
{
Containment::init();
- for (const auto &info: Plasma::PluginLoader::self()->listAppletInfo(QString())) {
- if (!info.isValid() || info.property(QStringLiteral("X-Plasma-NotificationArea")) != "true") {
+ for (const auto &info: Plasma::PluginLoader::self()->listAppletMetaData(QString())) {
+ if (!info.isValid() || info.value(QStringLiteral("X-Plasma-NotificationArea")) != "true") {
continue;
}
- m_systrayApplets[info.pluginName()] = info;
+ m_systrayApplets[info.pluginId()] = KPluginInfo(info);
- if (info.isPluginEnabledByDefault()) {
- m_defaultPlasmoids += info.pluginName();
+ if (info.isEnabledByDefault()) {
+ m_defaultPlasmoids += info.pluginId();
}
- const QString dbusactivation = info.property(QStringLiteral("X-Plasma-DBusActivationService")).toString();
+ const QString dbusactivation = info.value(QStringLiteral("X-Plasma-DBusActivationService"));
if (!dbusactivation.isEmpty()) {
- qCDebug(SYSTEM_TRAY) << "ST Found DBus-able Applet: " << info.pluginName() << dbusactivation;
- m_dbusActivatableTasks[info.pluginName()] = dbusactivation;
+ qCDebug(SYSTEM_TRAY) << "ST Found DBus-able Applet: " << info.pluginId() << dbusactivation;
+ m_dbusActivatableTasks[info.pluginId()] = dbusactivation;
}
}
}
@@ -119,12 +119,12 @@ void SystemTray::init()
void SystemTray::newTask(const QString &task)
{
foreach (Plasma::Applet *applet, applets()) {
- if (!applet->pluginInfo().isValid()) {
+ if (!applet->pluginMetaData().isValid()) {
continue;
}
//only allow one instance per applet
- if (task == applet->pluginInfo().pluginName()) {
+ if (task == applet->pluginMetaData().pluginId()) {
//Applet::destroy doesn't delete the applet from Containment::applets in the same event
//potentially a dbus activated service being restarted can be added in this time.
if (!applet->destroyed()) {
@@ -156,7 +156,7 @@ void SystemTray::newTask(const QString &task)
void SystemTray::cleanupTask(const QString &task)
{
foreach (Plasma::Applet *applet, applets()) {
- if (!applet->pluginInfo().isValid() || task == applet->pluginInfo().pluginName()) {
+ if (!applet->pluginMetaData().isValid() || task == applet->pluginMetaData().pluginId()) {
//we are *not* cleaning the config here, because since is one
//of those automatically loaded/unloaded by dbus, we want to recycle
//the config the next time it's loaded, in case the user configured something here
@@ -255,11 +255,11 @@ Q_INVOKABLE QString SystemTray::plasmoidCategory(QQuickItem *appletInterface) co
}
Plasma::Applet *applet = appletInterface->property("_plasma_applet").value<Plasma::Applet*>();
- if (!applet || !applet->pluginInfo().isValid()) {
+ if (!applet || !applet->pluginMetaData().isValid()) {
return "UnknownCategory";
}
- const QString cat = applet->pluginInfo().property(QStringLiteral("X-Plasma-NotificationAreaCategory")).toString();
+ const QString cat = applet->pluginMetaData().value(QStringLiteral("X-Plasma-NotificationAreaCategory"));
if (cat.isEmpty()) {
return "UnknownCategory";
@@ -385,11 +385,11 @@ void SystemTray::restorePlasmoids()
foreach (Plasma::Applet *applet, applets()) {
//Here it should always be valid.
//for some reason it not always is.
- if (!applet->pluginInfo().isValid()) {
+ if (!applet->pluginMetaData().isValid()) {
applet->config().parent().deleteGroup();
applet->deleteLater();
} else {
- const QString task = applet->pluginInfo().pluginName();
+ const QString task = applet->pluginMetaData().pluginId();
if (!m_allowedPlasmoids.contains(task)) {
//in those cases we do delete the applet config completely
//as they were explicitly disabled by the user
diff --git a/components/shellprivate/widgetexplorer/widgetexplorer.cpp b/components/shellprivate/widgetexplorer/widgetexplorer.cpp
index 7274d04..4915ab2 100644
--- a/components/shellprivate/widgetexplorer/widgetexplorer.cpp
+++ b/components/shellprivate/widgetexplorer/widgetexplorer.cpp
@@ -249,14 +249,14 @@ void WidgetExplorerPrivate::addContainment(Containment *containment)
QObject::connect(containment, SIGNAL(appletRemoved(Plasma::Applet*)), q, SLOT(appletRemoved(Plasma::Applet*)));
foreach (Applet *applet, containment->applets()) {
- if (applet->pluginInfo().isValid()) {
+ if (applet->pluginMetaData().isValid()) {
Containment *childContainment = applet->property("containment").value<Containment*>();
if (childContainment) {
addContainment(childContainment);
}
- runningApplets[applet->pluginInfo().pluginName()]++;
+ runningApplets[applet->pluginMetaData().pluginId()]++;
} else {
- qDebug() << "Invalid plugininfo. :(";
+ qDebug() << "Invalid plugin metadata. :(";
}
}
}
@@ -268,10 +268,10 @@ void WidgetExplorerPrivate::containmentDestroyed()
void WidgetExplorerPrivate::appletAdded(Plasma::Applet *applet)
{
- if (!applet->pluginInfo().isValid()) {
+ if (!applet->pluginMetaData().isValid()) {
return;
}
- QString name = applet->pluginInfo().pluginName();
+ QString name = applet->pluginMetaData().pluginId();
runningApplets[name]++;
appletNames.insert(applet, name);
@@ -471,9 +471,9 @@ void WidgetExplorer::uninstall(const QString &pluginName)
const auto &applets = c->applets();
foreach (Applet *applet, applets) {
- const auto &appletInfo = applet->pluginInfo();
+ const auto &appletInfo = applet->pluginMetaData();
- if (appletInfo.isValid() && appletInfo.pluginName() == pluginName) {
+ if (appletInfo.isValid() && appletInfo.pluginId() == pluginName) {
applet->destroy();
}
}
diff --git a/plasma-windowed/plasmawindowedcorona.cpp b/plasma-windowed/plasmawindowedcorona.cpp
index fbacbf8..b68d270 100644
--- a/plasma-windowed/plasmawindowedcorona.cpp
+++ b/plasma-windowed/plasmawindowedcorona.cpp
@@ -51,7 +51,7 @@ void PlasmaWindowedCorona::loadApplet(const QString &applet, const QVariantList
//forbid more instances per applet (todo: activate the correpsponding already loaded applet)
for (Plasma::Applet *a : cont->applets()) {
- if (a->pluginInfo().pluginName() == applet) {
+ if (a->pluginMetaData().pluginId() == applet) {
return;
}
}
diff --git a/runners/windowedwidgets/windowedwidgetsrunner.cpp b/runners/windowedwidgets/windowedwidgetsrunner.cpp
index 5ccbd27..7f093a7 100644
--- a/runners/windowedwidgets/windowedwidgetsrunner.cpp
+++ b/runners/windowedwidgets/windowedwidgetsrunner.cpp
@@ -60,24 +60,22 @@ void WindowedWidgetsRunner::match(Plasma::RunnerContext &context)
QList<Plasma::QueryMatch> matches;
- foreach (const KPluginInfo &info, Plasma::PluginLoader::self()->listAppletInfo(QString())) {
- KService::Ptr service = info.service();
-
- if (((service->name().contains(term, Qt::CaseInsensitive) ||
- service->genericName().contains(term, Qt::CaseInsensitive) ||
- service->comment().contains(term, Qt::CaseInsensitive)) ||
- service->categories().contains(term, Qt::CaseInsensitive) ||
+ foreach (const KPluginMetaData &md, Plasma::PluginLoader::self()->listAppletMetaData(QString())) {
+ if (((md.name().contains(term, Qt::CaseInsensitive) ||
+ md.value(QLatin1String("GenericName")).contains(term, Qt::CaseInsensitive) ||
+ md.description().contains(term, Qt::CaseInsensitive)) ||
+ md.category().contains(term, Qt::CaseInsensitive) ||
term.startsWith(i18nc("Note this is a KRunner keyword", "mobile applications"))) &&
- !info.property(QStringLiteral("NoDisplay")).toBool()) {
+ !md.rawData().value(QStringLiteral("NoDisplay")).toBool()) {
- QVariant val = info.property(QStringLiteral("X-Plasma-StandAloneApp"));
+ QVariant val = md.value(QStringLiteral("X-Plasma-StandAloneApp"));
if (!val.isValid() || !val.toBool()) {
continue;
}
Plasma::QueryMatch match(this);
- setupMatch(service, match);
- if (service->name().compare(term, Qt::CaseInsensitive) == 0) {
+ setupMatch(md, match);
+ if (md.name().compare(term, Qt::CaseInsensitive) == 0) {
match.setType(Plasma::QueryMatch::ExactMatch);
match.setRelevance(1);
} else {
@@ -85,8 +83,6 @@ void WindowedWidgetsRunner::match(Plasma::RunnerContext &context)
match.setRelevance(0.7);
}
matches << match;
-
- qDebug() << service;
}
}
@@ -100,27 +96,27 @@ void WindowedWidgetsRunner::match(Plasma::RunnerContext &context)
void WindowedWidgetsRunner::run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &match)
{
Q_UNUSED(context);
- KService::Ptr service = KService::serviceByStorageId(match.data().toString());
- if (service) {
- QProcess::startDetached(QStringLiteral("plasmawindowed"), QStringList() << service->property(QStringLiteral("X-KDE-PluginInfo-Name"), QVariant::String).toString());
+ KPluginMetaData md(match.data().toString());
+ if (md.isValid()) {
+ QProcess::startDetached(QStringLiteral("plasmawindowed"), QStringList() << md.pluginId());
}
}
-void WindowedWidgetsRunner::setupMatch(const KService::Ptr &service, Plasma::QueryMatch &match)
+void WindowedWidgetsRunner::setupMatch(const KPluginMetaData &md, Plasma::QueryMatch &match)
{
- const QString name = service->name();
+ const QString name = md.pluginId();
match.setText(name);
- match.setData(service->storageId());
+ match.setData(md.metaDataFileName());
- if (!service->genericName().isEmpty() && service->genericName() != name) {
- match.setSubtext(service->genericName());
- } else if (!service->comment().isEmpty()) {
- match.setSubtext(service->comment());
+ if (!md.name().isEmpty() && md.name() != name) {
+ match.setSubtext(md.name());
+ } else if (!md.description().isEmpty()) {
+ match.setSubtext(md.description());
}
- if (!service->icon().isEmpty()) {
- match.setIconName(service->icon());
+ if (!md.iconName().isEmpty()) {
+ match.setIconName(md.iconName());
}
}
diff --git a/runners/windowedwidgets/windowedwidgetsrunner.h b/runners/windowedwidgets/windowedwidgetsrunner.h
index 2294965..fbc8006 100644
--- a/runners/windowedwidgets/windowedwidgetsrunner.h
+++ b/runners/windowedwidgets/windowedwidgetsrunner.h
@@ -48,7 +48,7 @@ protected Q_SLOTS:
protected:
- void setupMatch(const KService::Ptr &service, Plasma::QueryMatch &action);
+ void setupMatch(const KPluginMetaData &md, Plasma::QueryMatch &action);
};
#endif
diff --git a/shell/alternativeshelper.cpp b/shell/alternativeshelper.cpp
index d0f5dfd..6d76307 100644
--- a/shell/alternativeshelper.cpp
+++ b/shell/alternativeshelper.cpp
@@ -38,12 +38,12 @@ AlternativesHelper::~AlternativesHelper()
QStringList AlternativesHelper::appletProvides() const
{
- return m_applet->pluginInfo().property(QStringLiteral("X-Plasma-Provides")).toStringList();
+ return KPluginMetaData::readStringList(m_applet->pluginMetaData().rawData(), QStringLiteral("X-Plasma-Provides"));
}
QString AlternativesHelper::currentPlugin() const
{
- return m_applet->pluginInfo().pluginName();
+ return m_applet->pluginMetaData().pluginId();
}
QQuickItem *AlternativesHelper::applet() const
@@ -53,7 +53,7 @@ QQuickItem *AlternativesHelper::applet() const
void AlternativesHelper::loadAlternative(const QString &plugin)
{
- if (plugin == m_applet->pluginInfo().pluginName() || m_applet->isContainment()) {
+ if (plugin == m_applet->pluginMetaData().pluginId() || m_applet->isContainment()) {
return;
}
diff --git a/shell/containmentconfigview.cpp b/shell/containmentconfigview.cpp
index cec067e..4c9d146 100644
--- a/shell/containmentconfigview.cpp
+++ b/shell/containmentconfigview.cpp
@@ -104,7 +104,7 @@ QAbstractItemModel *ContainmentConfigView::currentContainmentActionsModel()
QString ContainmentConfigView::containmentPlugin() const
{
- return m_containment->pluginInfo().pluginName();
+ return m_containment->pluginMetaData().pluginId();
}
void ContainmentConfigView::setContainmentPlugin(const QString &plugin)
diff --git a/shell/scripting/containment.cpp b/shell/scripting/containment.cpp
index 6040e62..96e2009 100644
--- a/shell/scripting/containment.cpp
+++ b/shell/scripting/containment.cpp
@@ -248,7 +248,7 @@ QScriptValue Containment::widgets(QScriptContext *context, QScriptEngine *engine
int count = 0;
foreach (Plasma::Applet *widget, c->d->containment.data()->applets()) {
- if (widgetType.isEmpty() || widget->pluginInfo().pluginName() == widgetType) {
+ if (widgetType.isEmpty() || widget->pluginMetaData().pluginId() == widgetType) {
widgets.setProperty(count, env->wrap(widget));
++count;
}
@@ -273,7 +273,7 @@ QString Containment::type() const
return QString();
}
- return d->containment.data()->pluginInfo().pluginName();
+ return d->containment.data()->pluginMetaData().pluginId();
}
void Containment::remove()
diff --git a/shell/scripting/widget.cpp b/shell/scripting/widget.cpp
index a651c2a..b58822b 100644
--- a/shell/scripting/widget.cpp
+++ b/shell/scripting/widget.cpp
@@ -65,7 +65,7 @@ uint Widget::id() const
QString Widget::type() const
{
if (d->applet) {
- return d->applet.data()->pluginInfo().pluginName();
+ return d->applet.data()->pluginMetaData().pluginId();
}
return QString();
diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp
index 152ffeb..2c3e734 100644
--- a/shell/shellcorona.cpp
+++ b/shell/shellcorona.cpp
@@ -406,7 +406,7 @@ QByteArray ShellCorona::dumpCurrentLayoutJS() const
|| cont->location() == Plasma::Types::BottomEdge
|| cont->location() == Plasma::Types::LeftEdge
|| cont->location() == Plasma::Types::RightEdge) &&
- cont->pluginInfo().pluginName() != QStringLiteral("org.kde.plasma.private.systemtray");
+ cont->pluginMetaData().pluginId() != QStringLiteral("org.kde.plasma.private.systemtray");
};
auto isDesktop = [] (Plasma::Containment *cont) {
@@ -486,7 +486,7 @@ QByteArray ShellCorona::dumpCurrentLayoutJS() const
KConfigGroup appletConfig = applet->config();
- appletJson.insert("plugin", applet->pluginInfo().pluginName());
+ appletJson.insert("plugin", applet->pluginMetaData().pluginId());
appletJson.insert("config", dumpconfigGroupJS(appletConfig));
appletsJsonArray << appletJson;
@@ -553,7 +553,7 @@ QByteArray ShellCorona::dumpCurrentLayoutJS() const
QJsonObject appletJson;
appletJson.insert("title", applet->title());
- appletJson.insert("plugin", applet->pluginInfo().pluginName());
+ appletJson.insert("plugin", applet->pluginMetaData().pluginId());
appletJson.insert("geometry.x", geometry.x() / gridUnit);
appletJson.insert("geometry.y", geometry.y() / gridUnit);
@@ -1230,11 +1230,11 @@ void ShellCorona::handleContainmentAdded(Plasma::Containment *c)
void ShellCorona::executeSetupPlasmoidScript(Plasma::Containment *containment, Plasma::Applet *applet)
{
- if (!applet->pluginInfo().isValid() || !containment->pluginInfo().isValid()) {
+ if (!applet->pluginMetaData().isValid() || !containment->pluginMetaData().isValid()) {
return;
}
- const QString scriptFile = m_lookAndFeelPackage.filePath("plasmoidsetupscripts", applet->pluginInfo().pluginName() + ".js");
+ const QString scriptFile = m_lookAndFeelPackage.filePath("plasmoidsetupscripts", applet->pluginMetaData().pluginId() + ".js");
if (scriptFile.isEmpty()) {
return;
@@ -1533,7 +1533,7 @@ Plasma::Containment *ShellCorona::setContainmentTypeForScreen(int screen, const
//if creation failed or invalid plugin, give up
if (!newContainment) {
return oldContainment;
- } else if (!newContainment->pluginInfo().isValid()) {
+ } else if (!newContainment->pluginMetaData().isValid()) {
newContainment->deleteLater();
return oldContainment;
}
@@ -1966,7 +1966,8 @@ void ShellCorona::activateLauncherMenu()
for (auto it = m_panelViews.constBegin(), end = m_panelViews.constEnd(); it != end; ++it) {
const auto applets = it.key()->applets();
for (auto applet : applets) {
- if (applet->pluginInfo().property("X-Plasma-Provides").toStringList().contains(QStringLiteral("org.kde.plasma.launchermenu"))) {
+ const auto provides = KPluginMetaData::readStringList(applet->pluginMetaData().rawData(), QStringLiteral("X-Plasma-Provides"));
+ if (provides.contains(QLatin1String("org.kde.plasma.launchermenu"))) {
if (!applet->globalShortcut().isEmpty()) {
emit applet->activated();
return;
--
2.7.4

@ -1,189 +0,0 @@
From 749f60b89f4a166833fb64a5b593a801f63f9615 Mon Sep 17 00:00:00 2001
From: Lindsay Roberts <m@lindsayr.com>
Date: Mon, 10 Oct 2016 19:55:49 +0300
Subject: [PATCH 33/59] Systray: Move all icon resolution to dataengine
Summary:
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.
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.
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.
BUG: 356479
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.
Reviewers: #plasma, davidedmundson, mart
Reviewed By: #plasma, davidedmundson, mart
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2986
---
.../package/contents/ui/ConfigEntries.qml | 2 +-
.../contents/ui/items/StatusNotifierItem.qml | 4 +-
applets/systemtray/systemtray.cpp | 52 ----------------------
applets/systemtray/systemtray.h | 6 ---
.../statusnotifieritemsource.cpp | 9 +++-
5 files changed, 10 insertions(+), 63 deletions(-)
diff --git a/applets/systemtray/package/contents/ui/ConfigEntries.qml b/applets/systemtray/package/contents/ui/ConfigEntries.qml
index ca8b058..aefac23 100644
--- a/applets/systemtray/package/contents/ui/ConfigEntries.qml
+++ b/applets/systemtray/package/contents/ui/ConfigEntries.qml
@@ -75,7 +75,7 @@ QtLayouts.GridLayout {
"index": i,
"taskId": item.Id,
"name": item.Title,
- "iconName": plasmoid.nativeInterface.resolveIcon(item.IconName, item.IconThemePath),
+ "iconName": item.IconName,
"icon": item.Icon
});
}
diff --git a/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml b/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml
index 115e1fb..889b8b5 100644
--- a/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml
+++ b/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml
@@ -28,7 +28,7 @@ AbstractItem {
text: Title
mainText: ToolTipTitle != "" ? ToolTipTitle : Title
subText: ToolTipSubTitle
- icon: ToolTipIcon != "" ? ToolTipIcon : plasmoid.nativeInterface.resolveIcon(IconName != "" ? IconName : Icon, IconThemePath)
+ icon: ToolTipIcon != "" ? ToolTipIcon : Icon ? Icon : IconName
textFormat: Text.AutoText
category: Category
@@ -48,7 +48,7 @@ AbstractItem {
PlasmaCore.IconItem {
id: iconItem
- source: plasmoid.nativeInterface.resolveIcon(IconName != "" ? IconName : Icon, IconThemePath)
+ source: Icon ? Icon : IconName
width: Math.min(parent.width, parent.height)
height: width
active: taskIcon.containsMouse
diff --git a/applets/systemtray/systemtray.cpp b/applets/systemtray/systemtray.cpp
index ecc23a4..3234dd1 100644
--- a/applets/systemtray/systemtray.cpp
+++ b/applets/systemtray/systemtray.cpp
@@ -37,37 +37,11 @@
#include <Plasma/PluginLoader>
#include <Plasma/ServiceJob>
-#include <KIconLoader>
-#include <KIconEngine>
#include <KActionCollection>
#include <KLocalizedString>
#include <plasma_version.h>
-/*
- * An app may also load icons from their own directories, so we need a new iconloader that takes this into account
- * This is wrapped into a subclass of iconengine so the iconloader lifespan matches the icon object
- */
-class AppIconEngine : public KIconEngine
-{
-public:
- AppIconEngine(const QString &variant, const QString &path, const QString &appName);
- ~AppIconEngine();
-private:
- KIconLoader* m_loader;
-};
-
-AppIconEngine::AppIconEngine(const QString &variant, const QString &path, const QString &appName) :
- KIconEngine(variant, m_loader = new KIconLoader(appName, QStringList()))
-{
- m_loader->addAppDir(appName, path);
-}
-
-AppIconEngine::~AppIconEngine()
-{
- delete m_loader;
-}
-
class PlasmoidModel: public QStandardItemModel
{
public:
@@ -169,32 +143,6 @@ void SystemTray::cleanupTask(const QString &task)
}
}
-QVariant SystemTray::resolveIcon(const QVariant &variant, const QString &iconThemePath)
-{
- if (variant.canConvert<QString>()) {
- if (!iconThemePath.isEmpty()) {
- const QString path = iconThemePath;
- if (!path.isEmpty()) {
- // FIXME: If last part of path is not "icons", this won't work!
- auto tokens = path.splitRef('/', QString::SkipEmptyParts);
- if (tokens.length() >= 3 && tokens.takeLast() == QLatin1String("icons")) {
- const QString appName = tokens.takeLast().toString();
-
- return QVariant(QIcon(new AppIconEngine(variant.toString(), path, appName)));
- } else {
- qCWarning(SYSTEM_TRAY) << "Wrong IconThemePath" << path << ": too short or does not end with 'icons'";
- }
- }
-
- //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
- return variant;
- }
- }
-
- // Most importantly QIcons. Nothing to do for those.
- return variant;
-}
-
void SystemTray::showPlasmoidMenu(QQuickItem *appletInterface, int x, int y)
{
if (!appletInterface) {
diff --git a/applets/systemtray/systemtray.h b/applets/systemtray/systemtray.h
index 953d81b..0a93fe2 100644
--- a/applets/systemtray/systemtray.h
+++ b/applets/systemtray/systemtray.h
@@ -60,12 +60,6 @@ public:
//Invokable utilities
/**
- * returns either a simple icon name or a custom path if the app is
- * using a custom theme
- */
- Q_INVOKABLE QVariant resolveIcon(const QVariant &variant, const QString &iconThemePath);
-
- /**
* Given an AppletInterface pointer, shows a proper context menu for it
*/
Q_INVOKABLE void showPlasmoidMenu(QQuickItem *appletInterface, int x, int y);
diff --git a/dataengines/statusnotifieritem/statusnotifieritemsource.cpp b/dataengines/statusnotifieritem/statusnotifieritemsource.cpp
index 2df5e79..d835d50 100644
--- a/dataengines/statusnotifieritem/statusnotifieritemsource.cpp
+++ b/dataengines/statusnotifieritem/statusnotifieritemsource.cpp
@@ -240,14 +240,19 @@ void StatusNotifierItemSource::refreshCallback(QDBusPendingCallWatcher *call)
if (!m_customIconLoader) {
m_customIconLoader = new KIconLoader(QString(), QStringList(), this);
}
+ // FIXME: If last part of path is not "icons", this won't work!
+ QString appName;
+ auto tokens = path.splitRef('/', QString::SkipEmptyParts);
+ if (tokens.length() >= 3 && tokens.takeLast() == QLatin1String("icons"))
+ appName = tokens.takeLast().toString();
//icons may be either in the root directory of the passed path or in a appdir format
//i.e hicolor/32x32/iconname.png
- m_customIconLoader->reconfigure(QString(), QStringList(path));
+ m_customIconLoader->reconfigure(appName, QStringList(path));
//add app dir requires an app name, though this is completely unused in this context
- m_customIconLoader->addAppDir(QStringLiteral("unused"), path);
+ m_customIconLoader->addAppDir(appName.size() ? appName : QStringLiteral("unused"), path);
}
setData(QStringLiteral("IconThemePath"), path);
--
2.7.4

@ -7,7 +7,7 @@
Name: plasma-workspace Name: plasma-workspace
Summary: Plasma workspace, applications and applets Summary: Plasma workspace, applications and applets
Version: 5.8.5 Version: 5.8.5
Release: 2%{?dist} Release: 3%{?dist}
License: GPLv2+ License: GPLv2+
URL: https://quickgit.kde.org/?p=%{name}.git URL: https://quickgit.kde.org/?p=%{name}.git
@ -54,12 +54,16 @@ Patch51: kde-runtime-4.9.0-installdbgsymbols.patch
# dnf debuginfo-install # dnf debuginfo-install
Patch52: plasma-workspace-5.6.4-installdbgsymbols.patch Patch52: plasma-workspace-5.6.4-installdbgsymbols.patch
## upstream Patches ## upstream Patches (5.8 branch) lookaside cache
Patch1: 0001-use-a-native-event-filter-to-notice-the-screen-was-s.patch
Patch2: 0002-Systray-Move-all-icon-resolution-to-dataengine.patch
Patch3: 0003-MPRIS-Data-Engine-Don-t-crash-if-Metadata-is-a-map-b.patch
Patch4: 0004-Fix-Pinned-Chrome-disappears-when-all-Chrome-windows.patch
Patch5: 0005-better-clean-up-of-duplicate-containments.patch
Patch6: 0006-MediaController-Update-position-while-queuedPosition.patch
Patch7: 0007-Corona-screenGeometryChanged-on-qscreen-resized.patch
## upstream Patches (master branch) ## upstream Patches (master branch)
# systray-related fixes
Patch31: 0031-Port-to-new-plasma-framework-API.patch
Patch33: 0033-Systray-Move-all-icon-resolution-to-dataengine.patch
# udev # udev
BuildRequires: zlib-devel BuildRequires: zlib-devel
@ -433,9 +437,13 @@ BuildArch: noarch
%setup -q %setup -q
## upstream patches ## upstream patches
%patch1 -p1 -b .0001
#patch31 -p1 -b .0031 %patch2 -p1 -b .0002
%patch33 -p1 -b .0033 %patch3 -p1 -b .0003
%patch4 -p1 -b .0004
%patch5 -p1 -b .0005
%patch6 -p1 -b .0006
%patch7 -p1 -b .0007
%if 0%{?fedora} > 23 %if 0%{?fedora} > 23
# dnf debuginfo-install # dnf debuginfo-install
@ -711,6 +719,9 @@ fi
%changelog %changelog
* Thu Jan 19 2017 Rex Dieter <rdieter@fedoraproject.org> - 5.8.5-3
- pull in 5.8 branch fixes
* Mon Jan 02 2017 Rex Dieter <rdieter@fedoraproject.org> - 5.8.5-2 * Mon Jan 02 2017 Rex Dieter <rdieter@fedoraproject.org> - 5.8.5-2
- filter qml/plugin provides - filter qml/plugin provides

@ -1 +1,8 @@
SHA512 (plasma-workspace-5.8.5.tar.xz) = c4173bd4db3dc31c0435192b1569bdb44488f9f17b4cb5468b4af562b9dbb0934106caf92ea65e9e6b24f8dadcdda08cee07d64bee8b0f52398e07f39fbb97f6 SHA512 (plasma-workspace-5.8.5.tar.xz) = c4173bd4db3dc31c0435192b1569bdb44488f9f17b4cb5468b4af562b9dbb0934106caf92ea65e9e6b24f8dadcdda08cee07d64bee8b0f52398e07f39fbb97f6
SHA512 (0001-use-a-native-event-filter-to-notice-the-screen-was-s.patch) = 8289ecedab57b211e9a72fc0e85129dbc8b41c4552389df5b6625a7bc3db4c845e01b433d5da6fe58717c217e804d7e0df4fc7a15d6316384b49ffaa08e5e1e7
SHA512 (0002-Systray-Move-all-icon-resolution-to-dataengine.patch) = 436d3a923db41e347a8a57f2894922dd21f6abbb8ccf822170da6c6a444f43bc4851e00bb0cf271cff354ab0d9a779e3066b40f8706a65cb40d24cb602cf5712
SHA512 (0003-MPRIS-Data-Engine-Don-t-crash-if-Metadata-is-a-map-b.patch) = e6a866f174ad6da348ee47fcff56c70523d8a10eae12e1edf298386f1a068fe50e8fcf224ef5f0cb15f83ca104581840f554b726ea55efe4e8194dbd43af4806
SHA512 (0004-Fix-Pinned-Chrome-disappears-when-all-Chrome-windows.patch) = 439f9da604b19f756c19831ec4853e217433464ff982b559f5726cba84e89a477b0d13408e99ab905a133d69038075c2cb273c840c2b2fd18ff7382347c7acbc
SHA512 (0005-better-clean-up-of-duplicate-containments.patch) = b6054c802ba3cf1708a976c1c370af3b11232c4660304c3f519f16f1b74722a7f24a7209e9647ae0d811eb30956787fe0bc4b900f87ff25db974c245d3a26ccc
SHA512 (0006-MediaController-Update-position-while-queuedPosition.patch) = b4c7be1105a1aa38aef3c600587c435550643a1b3c0363de62eebd4fc28cdddf1d66869b3642fc0392d3e669d393850212628c6be68a6c3bd809fb5db47368b3
SHA512 (0007-Corona-screenGeometryChanged-on-qscreen-resized.patch) = 0b0319108e610e21101cccb2486844e77fdb93b01f94635d8b97858b415c03e4bc3ad1f196704d46b6f2f08f6fef21993e0833b02a2d9ad601d1b4cfdf44dfe0

Loading…
Cancel
Save