From e9bddef8eea7f33b999b4bee77ed95d4b7061c10 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Wed, 25 Feb 2015 16:20:22 +0100 Subject: [PATCH] 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 --- src/plasma/data/servicetypes/plasma-applet.desktop | 3 +++ src/plasmaquick/packageurlinterceptor.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plasma/data/servicetypes/plasma-applet.desktop b/src/plasma/data/servicetypes/plasma-applet.desktop index 3b696d98a..476c819d9 100644 --- a/src/plasma/data/servicetypes/plasma-applet.desktop +++ b/src/plasma/data/servicetypes/plasma-applet.desktop @@ -66,3 +66,6 @@ Type=QStringList [PropertyDef::X-Plasma-StandAloneApp] Type=bool + +[PropertyDef::X-Plasma-RequiredExtensions] +Type=QStringList diff --git a/src/plasmaquick/packageurlinterceptor.cpp b/src/plasmaquick/packageurlinterceptor.cpp index 128254d23..5f77c3adb 100644 --- a/src/plasmaquick/packageurlinterceptor.cpp +++ b/src/plasmaquick/packageurlinterceptor.cpp @@ -115,7 +115,7 @@ QUrl PackageUrlInterceptor::intercept(const QUrl &path, QQmlAbstractUrlIntercept //forbid to load random absolute paths } else { - if (m_package.allowExternalPaths()) { + if (m_package.allowExternalPaths() || m_package.metadata().property("X-Plasma-RequiredExtensions").toString().contains(QStringLiteral("ExternalScripts"))) { return path; }