On Monday 18 May 2015, Ivan Čukić wrote:
>  - make it opt-in (as Marco says)
>  - deprecate it
>  - report notifications to the user 'this applet might make your
> desktop unstable' for all used applets that haven't opted-in - this
> would serve as a notification both to the users and the developers of
> said applets
>  - schedule marking the support for these applets for the release
> after next, or something.

this is with the explicitly white list
is a thing that kills kittens and is over the top weird behavior, but at least 
doesn't force to litter metadatas and makes possible to definitely drop the 
legacy at some point

-- 
Marco Martin
diff --git a/src/plasmaquick/appletquickitem.cpp b/src/plasmaquick/appletquickitem.cpp
index 3ffe269..b6d23d3 100644
--- a/src/plasmaquick/appletquickitem.cpp
+++ b/src/plasmaquick/appletquickitem.cpp
@@ -42,6 +42,9 @@ namespace PlasmaQuick
 
 QHash<QObject *, AppletQuickItem *> AppletQuickItemPrivate::s_rootObjects = QHash<QObject *, AppletQuickItem *>();
 
+QSet<QString> AppletQuickItemPrivate::s_legacyApplets = QSet<QString>({"org.kde.plasma.bluetooth", "org.kde.plasma.pager", "org.kde.desktopcontainment", "org.kde.plasma.folder", "org.kde.panel", "org.kde.plasma.analogclock", "org.kde.plasma.battery", "org.kde.plasma.systemtray"});
+
+
 AppletQuickItemPrivate::AppletQuickItemPrivate(Plasma::Applet *a, AppletQuickItem *item)
     : q(item),
       switchWidth(-1),
@@ -49,7 +52,13 @@ AppletQuickItemPrivate::AppletQuickItemPrivate(Plasma::Applet *a, AppletQuickIte
       applet(a),
       expanded(false)
 {
-    if (a->pluginInfo().property("X-Plasma-RequiredExtensions").toStringList().contains("SharedEngine")) {
+    //TODO: remove the legacy support at some point
+    //use the shared engine only for applets that are nt in the legacy list
+    //if they are, use the shared engine if their mayor version is at least 3
+    const QStringList version = a->pluginInfo().version().split(".");
+    if (!AppletQuickItemPrivate::s_legacyApplets.contains(a->pluginInfo().pluginName()) ||
+         (!version.isEmpty() && version.first().toInt() >= 3)) {
+
         qmlObject = new KDeclarative::QmlObjectSharedEngine(q);
         if (!qmlObject->engine()->urlInterceptor()) {
             PackageUrlInterceptor *interceptor = new PackageUrlInterceptor(qmlObject->engine(), Plasma::Package());
diff --git a/src/plasmaquick/private/appletquickitem_p.h b/src/plasmaquick/private/appletquickitem_p.h
index c754a80..79c1a2e 100644
--- a/src/plasmaquick/private/appletquickitem_p.h
+++ b/src/plasmaquick/private/appletquickitem_p.h
@@ -104,6 +104,7 @@ public:
     bool expanded : 1;
 
     static QHash<QObject *, AppletQuickItem *> s_rootObjects;
+    static QSet<QString> s_legacyApplets;
 };
 
 }
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

Reply via email to