diff --git a/src/plasma/data/servicetypes/plasma-applet.desktop b/src/plasma/data/servicetypes/plasma-applet.desktop index dfd6fe8ba..247bbfb5d 100644 --- a/src/plasma/data/servicetypes/plasma-applet.desktop +++ b/src/plasma/data/servicetypes/plasma-applet.desktop @@ -38,6 +38,9 @@ Comment[zh_TW]=Plasma 小程式 [PropertyDef::X-Plasma-API] Type=QString +[PropertyDef::X-Plasma-RootPath] +Type=QString + [PropertyDef::X-Plasma-DropMimeTypes] Type=QStringList diff --git a/src/plasma/private/applet_p.cpp b/src/plasma/private/applet_p.cpp index 4f00d90e3..684350570 100644 --- a/src/plasma/private/applet_p.cpp +++ b/src/plasma/private/applet_p.cpp @@ -132,7 +132,10 @@ void AppletPrivate::init(const QString &packagePath, const QVariantList &args) return; } - const QString path = packagePath.isEmpty() ? appletDescription.pluginName() : packagePath; + QString path = appletDescription.property("X-Plasma-RootPath").toString(); + if (path.isEmpty()) { + path = packagePath.isEmpty() ? appletDescription.pluginName() : packagePath; + } package = new Package(PluginLoader::self()->loadPackage("Plasma/Applet", api)); package->setPath(path);