SVN commit 769246 by mkretz: Sorry for breaking loading of the GStreamer backend from the platform plugin again, but the plugin should only get loaded from a Qt plugin dir. If it's in a KDE module dir it should be a KDE plugin. So the CMakeLists.txt for Phonon-GStreamer needs to be changed. M +20 -24 kdepluginfactory.cpp --- trunk/KDE/kdelibs/phonon/platform_kde/kdepluginfactory.cpp #769245:769246 @@ -22,6 +22,7 @@ #include "kdepluginfactory.h" #include "kiomediastream.h" +#include #include #include #include @@ -120,50 +121,45 @@ // This code is in here temporarily until NMM gets fixed. // Currently the NMM backend will fail with undefined symbols if // the backend is not loaded with global symbol resolution + QObject *backend = 0; factory = KLibLoader::self()->factory(newService->library(), QLibrary::ExportExternalSymbolsHint); if (!factory) { errorReason = KLibLoader::self()->lastErrorMessage(); - kError(600) << "Can not create factory for " << newService->name() << - ":\n" << errorReason << endl; - - KMessageBox::error(0, - QLatin1String("") - + i18n("Unable to use the %1 Multimedia Backend:", newService->name()) - + QLatin1Char('\n') - + errorReason - + QLatin1String("")); - return false; + } else { + QObject *backend = factory->create(); + if (0 == backend) { + errorReason = i18n("create method returned 0"); + } } - QObject *backend = factory->create(); - if (0 == backend) { - errorReason = i18n("create method returned 0"); - } #else QObject *backend = newService->createInstance(0, QVariantList(), &errorReason); - +#endif 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()) { + const QLatin1String suffix("/phonon_backend/"); + const QStringList libFilter(newService->library() + QLatin1String(".*")); + foreach (QString libPath, QCoreApplication::libraryPaths()) { + libPath += suffix; + const QDir dir(libPath); + foreach (const QString &pluginName, dir.entryList(libFilter, QDir::Files)) { + QPluginLoader pluginLoader(pluginName); backend = pluginLoader.instance(); if (backend) { break; } } + if (backend) { + break; + } } } -#endif if (0 == backend) { kError(600) << "Can not create backend object from factory for " << - newService->name() << ", " << newService->library() << ":\n" << errorReason << endl; + newService->name() << ", " << newService->library() << ":\n" << errorReason; KMessageBox::error(0, i18n("Unable to use the %1 Multimedia Backend:
%2
", newService->name(), errorReason)); - return false; + return 0; } kDebug() << "using backend: " << newService->name();