From kde-commits Mon Jan 21 20:59:26 2008 From: Andre Moreira Magalhaes Date: Mon, 21 Jan 2008 20:59:26 +0000 To: kde-commits Subject: KDE/kdelibs/phonon/platform_kde Message-Id: <1200949166.253537.12856.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=120094918512439 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 #include #include +#include namespace Phonon { @@ -137,6 +138,21 @@ } #else QObject *backend = newService->createInstance(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 " <<