KDECore
Go to the documentation of this file.
21 #include <QtCore/QFile>
22 #include <QtCore/QDir>
23 #include <QtCore/QTimer>
24 #include <QtCore/QLibrary>
26 #include <QtCore/QCoreApplication>
27 #include <QtCore/QObjectCleanupHandler>
34 class KLibLoaderPrivate
38 QObjectCleanupHandler cleanuphandler;
44 #define KLIBLOADER_PRIVATE KLibLoaderPrivate *const d = kLibLoaderPrivate
48 return &kLibLoaderPrivate->instance;
51 KLibLoader::KLibLoader()
56 KLibLoader::~KLibLoader()
68 int pos = libname.lastIndexOf( QLatin1Char(
'/') );
71 QString file = libname.mid( pos + 1 );
72 QString path = libname.left( pos );
73 if( !file.startsWith( QLatin1String(
"lib") ) )
75 return path + QLatin1Char(
'/') + file.mid( 3 );
77 if( !libname.startsWith( QLatin1String(
"lib") ) )
79 return libname.mid( 3 );
98 kLibLoaderPrivate->errorString =
i18n(
"Library \"%1\" not found",_name);
103 lib->setLoadHints(hint);
107 if (!lib->isLoaded()) {
108 kLibLoaderPrivate->errorString = lib->errorString();
113 kLibLoaderPrivate->cleanuphandler.add(lib);
120 return kLibLoaderPrivate->errorString;
144 switch ( componentLoadingError ) {
146 return i18n(
"No service matching the requirements was found." );
148 return i18n(
"The service provides no library, the Library key is missing in the .desktop file." );
150 return kLibLoaderPrivate->instance.lastErrorMessage();
152 return i18n(
"The library does not export a factory for creating components." );
154 return i18n(
"The factory does not support creating components of the specified type." );
156 return i18n(
"KLibLoader: Unknown error" );
160 #include "klibloader.moc"
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Fri Jul 12 2013 08:50:16 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.