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:
Aleix Pol 2015-02-25 16:20:22 +01:00
parent f752138302
commit e9bddef8ee
2 changed files with 4 additions and 1 deletions

View File

@ -66,3 +66,6 @@ Type=QStringList
[PropertyDef::X-Plasma-StandAloneApp] [PropertyDef::X-Plasma-StandAloneApp]
Type=bool Type=bool
[PropertyDef::X-Plasma-RequiredExtensions]
Type=QStringList

View File

@ -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;
} }