Make it possible to let plasmoids to load scripts outside the plasma package
Adds a X-Plasma-Requires property for the plasmoid metadata files that will specify the features. Furthermore, adds a feature called ExternalScripts so that a plasmoid can request to load files that are outside of the import directories. REVIEW: 122595
This commit is contained in:
parent
f752138302
commit
e9bddef8ee
@ -66,3 +66,6 @@ Type=QStringList
|
|||||||
|
|
||||||
[PropertyDef::X-Plasma-StandAloneApp]
|
[PropertyDef::X-Plasma-StandAloneApp]
|
||||||
Type=bool
|
Type=bool
|
||||||
|
|
||||||
|
[PropertyDef::X-Plasma-RequiredExtensions]
|
||||||
|
Type=QStringList
|
||||||
|
@ -115,7 +115,7 @@ QUrl PackageUrlInterceptor::intercept(const QUrl &path, QQmlAbstractUrlIntercept
|
|||||||
|
|
||||||
//forbid to load random absolute paths
|
//forbid to load random absolute paths
|
||||||
} else {
|
} else {
|
||||||
if (m_package.allowExternalPaths()) {
|
if (m_package.allowExternalPaths() || m_package.metadata().property("X-Plasma-RequiredExtensions").toString().contains(QStringLiteral("ExternalScripts"))) {
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user