[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/phonon/platform_kde
From: Matthias Kretz <kretz () kde ! org>
Date: 2007-09-11 15:55:27
Message-ID: 1189526127.953100.29185.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 711166 by mkretz:
simplify backend loading code for the non-ExportExternalSymbols case
M +10 -22 kdepluginfactory.cpp
--- trunk/KDE/kdelibs/phonon/platform_kde/kdepluginfactory.cpp #711165:711166
@@ -110,28 +110,15 @@
QObject *KdePlatformPlugin::createBackend(KService::Ptr newService)
{
- KPluginFactory *factory = 0;
QString errorReason;
#ifdef PHONON_LOAD_BACKEND_GLOBAL
+ KLibFactory *factory = 0;
// 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
- //KLibrary *library = KLibLoader::self()->factory(newService->library(), \
QLibrary::ExportExternalSymbolsHint);
- //if (library) {
- // factory = library->factory();
- //}
- factory = KLibLoader::self()->factory(QFile::encodeName(newService->library()), \
QLibrary::ExportExternalSymbolsHint); + factory = \
KLibLoader::self()->factory(newService->library(), \
QLibrary::ExportExternalSymbolsHint); if (!factory) {
errorReason = KLibLoader::self()->lastErrorMessage();
- }
-#else
- KPluginLoader loader(QFile::encodeName(newService->library()));
- factory = loader.factory();
- if (!factory) {
- errorReason = loader.errorString();
- }
-#endif
- if (!factory) {
kError(600) << "Can not create factory for " << newService->name() <<
":\n" << errorReason << endl;
@@ -143,19 +130,20 @@
+ QLatin1String("</html>"));
return false;
}
-
QObject *backend = factory->create<QObject>();
if (0 == backend) {
- QString errorReason = i18n("create method returned 0");
+ errorReason = i18n("create method returned 0");
+ }
+#else
+ QObject *backend = newService->createInstance<QObject>(0, QVariantList(), \
&errorReason); +#endif
+ if (0 == backend) {
kError(600) << "Can not create backend object from factory for " <<
newService->name() << ", " << newService->library() << ":\n" << \
errorReason << endl;
KMessageBox::error(0,
- QLatin1String("<qt>")
- + i18n("Unable to use the <b>%1</b> Multimedia Backend:", \
newService->name())
- + QLatin1Char('\n')
- + errorReason
- + QLatin1String("<qt>"));
+ i18n("<qt>Unable to use the <b>%1</b> Multimedia \
Backend:<br/>%2</qt>", + newService->name(), errorReason));
return false;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic