[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [plasma-framework/mart/sycocacleanup] src/plasma: fix listContainmentsOfType and other statics
From:       Marco Martin <notmart () gmail ! com>
Date:       2015-04-30 16:18:09
Message-ID: E1YnrA9-000412-On () scm ! kde ! org
[Download RAW message or body]

Git commit 127fc63fa4e7f45c1ce602a9bb9ff001dfa125c4 by Marco Martin.
Committed on 30/04/2015 at 16:16.
Pushed by mart into branch 'mart/sycocacleanup'.

fix listContainmentsOfType and other statics

unfortunately we need an instance anyways due to the initialization
of the known internal structures

Change-Id: I9b3fd96cdd613590d66f0e80e6f920bb0fb96f36

M  +16   -1    src/plasma/pluginloader.cpp

http://commits.kde.org/plasma-framework/127fc63fa4e7f45c1ce602a9bb9ff001dfa125c4

diff --git a/src/plasma/pluginloader.cpp b/src/plasma/pluginloader.cpp
index 6159ea0..8c657ff 100644
--- a/src/plasma/pluginloader.cpp
+++ b/src/plasma/pluginloader.cpp
@@ -290,6 +290,9 @@ DataEngine *PluginLoader::loadDataEngine(const QString &name)
 
 QStringList PluginLoader::listAllEngines(const QString &parentApp)
 {
+    //HACK: we actually need an instance for this to work correctly
+    self();
+
     QStringList engines;
     // Look for C++ plugins first
     auto filter = [&parentApp](const KPluginMetaData &md) -> bool
@@ -317,11 +320,16 @@ QStringList PluginLoader::listAllEngines(const QString \
&parentApp)  
 KPluginInfo::List PluginLoader::listEngineInfo(const QString &parentApp)
 {
+    //HACK: we actually need an instance for this to work correctly
+    self();
     return PluginLoader::self()->listDataEngineInfo(parentApp);
 }
 
 KPluginInfo::List PluginLoader::listEngineInfoByCategory(const QString &category, \
const QString &parentApp)  {
+    //HACK: we actually need an instance for this to work correctly
+    self();
+
     KPluginInfo::List list;
 
     // Look for C++ plugins first
@@ -664,11 +672,14 @@ KPluginInfo::List PluginLoader::listContainmentsOfType(const \
QString &type,  const QString &category,
         const QString &parentApp)
 {
+    //HACK: we actually need an instance for this to work correctly
+    self();
+
     KConfigGroup group(KSharedConfig::openConfig(), "General");
     const QStringList excluded = group.readEntry("ExcludeCategories", \
                QStringList());
     auto filter = [&type, &category, &parentApp](const KPluginMetaData &md) -> bool
     {
-        if (!md.value("X-KDE-ServiceTypes").contains("Plasma/Containment")) {
+        if (!md.serviceTypes().contains("Plasma/Containment")) {
             return false;
         }
         const QString pa = md.value("X-KDE-ParentApp");
@@ -692,6 +703,8 @@ KPluginInfo::List PluginLoader::listContainmentsOfType(const \
QString &type,  
 KPluginInfo::List PluginLoader::listContainmentsForMimeType(const QString &mimeType)
 {
+    //HACK: we actually need an instance for this to work correctly
+    self();
     auto filter = [&mimeType](const KPluginMetaData &md) -> bool
     {
         return md.value("X-KDE-ServiceTypes").contains("Plasma/Containment") && \
md.value("X-Plasma-DropMimeTypes").contains(mimeType); @@ -702,6 +715,8 @@ \
KPluginInfo::List PluginLoader::listContainmentsForMimeType(const QString &mimeT  
 QStringList PluginLoader::listContainmentTypes()
 {
+    //HACK: we actually need an instance for this to work correctly
+    self();
     KPluginInfo::List containmentInfos = listContainments();
     QSet<QString> types;
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic