From 7736fc8dfa7c12f72c3206f7c16e00ae28783d7e Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 27 Jan 2022 13:33:02 +0100 Subject: [PATCH] applets/systemmonitor: Don't load "metadata.desktop" to determine preset Applets were apparently blindly converted to use JSON metadata without checking the usage. At least KPackage now has a direct getter for the package metadata, so use that to get the plugin ID instead of manually loading the package metadata. BUG: 448529 --- applets/systemmonitor/systemmonitor/systemmonitor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applets/systemmonitor/systemmonitor/systemmonitor.cpp b/applets/systemmonitor/systemmonitor/systemmonitor.cpp index 3d8b033b7..29e60c847 100644 --- a/applets/systemmonitor/systemmonitor/systemmonitor.cpp +++ b/applets/systemmonitor/systemmonitor/systemmonitor.cpp @@ -45,7 +45,7 @@ void SystemMonitor::init() // NOTE: taking the pluginId this way, we take it from the child applet (cpu monitor, memory, whatever) rather than the parent fallback applet // (systemmonitor) - const QString pluginId = KPluginMetaData(kPackage().path() + QStringLiteral("metadata.desktop")).pluginId(); + const QString pluginId = kPackage().metadata().pluginId(); // FIXME HACK: better way to get the engine At least AppletQuickItem should have an engine() getter KDeclarative::QmlObjectSharedEngine *qmlObject = new KDeclarative::QmlObjectSharedEngine();