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

List:       kde-commits
Subject:    KDE/kdelibs/phonon/platform_kde
From:       Andre Moreira Magalhaes <andrunko () yahoo ! com ! br>
Date:       2008-01-21 20:59:26
Message-ID: 1200949166.253537.12856.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 764460 by andrunko:

Tries to load the module using QPluginLoader if it can't be loaded
using KService::createInstance().


 M  +16 -0     kdepluginfactory.cpp  


--- trunk/KDE/kdelibs/phonon/platform_kde/kdepluginfactory.cpp #764459:764460
@@ -37,6 +37,7 @@
 #include <kservice.h>
 #include <kservicetypetrader.h>
 #include <kconfiggroup.h>
+#include <kstandarddirs.h>
 
 namespace Phonon
 {
@@ -137,6 +138,21 @@
     }
 #else
     QObject *backend = newService->createInstance<QObject>(0, QVariantList(), &errorReason);
+
+    if (0 == backend) {
+        const KComponentData cData = KGlobal::mainComponent();
+        QStringList modulePathList = cData.dirs()->findAllResources("module",
+                newService->library() + QLatin1String(".*"));
+        foreach (QString libFile, modulePathList) {
+            QPluginLoader pluginLoader(libFile);
+            if (pluginLoader.load()) {
+                backend = pluginLoader.instance();
+                if (backend) {
+                    break;
+                }
+            }
+        }
+    }
 #endif
     if (0 == backend) {
         kError(600) << "Can not create backend object from factory for " <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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