allow applets specify a different root than pluginname
introduce X-Plasma-RootPath: it would be used instead of the plugin name for package root path if present
This commit is contained in:
parent
419d97cfe0
commit
2482eb193c
@ -38,6 +38,9 @@ Comment[zh_TW]=Plasma 小程式
|
|||||||
[PropertyDef::X-Plasma-API]
|
[PropertyDef::X-Plasma-API]
|
||||||
Type=QString
|
Type=QString
|
||||||
|
|
||||||
|
[PropertyDef::X-Plasma-RootPath]
|
||||||
|
Type=QString
|
||||||
|
|
||||||
[PropertyDef::X-Plasma-DropMimeTypes]
|
[PropertyDef::X-Plasma-DropMimeTypes]
|
||||||
Type=QStringList
|
Type=QStringList
|
||||||
|
|
||||||
|
@ -132,7 +132,10 @@ void AppletPrivate::init(const QString &packagePath, const QVariantList &args)
|
|||||||
return;
|
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 = new Package(PluginLoader::self()->loadPackage("Plasma/Applet", api));
|
||||||
package->setPath(path);
|
package->setPath(path);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user