KDECore
kpluginloader.cpp
Go to the documentation of this file.
119 kDebug(kLibraryDebugArea()) << "library" << libname << "not found under 'module' but under 'lib'";
133 KPluginLoader::KPluginLoader(const QString &plugin, const KComponentData &componentdata, QObject *parent)
134 : QPluginLoader(findLibraryInternal(plugin, componentdata), parent), d_ptr(new KPluginLoaderPrivate(plugin))
150 KPluginLoader::KPluginLoader(const KService &service, const KComponentData &componentdata, QObject *parent)
151 : QPluginLoader(findLibraryInternal(service.library(), componentdata), parent), d_ptr(new KPluginLoaderPrivate(service.library()))
165 d->errorString = i18n("The service '%1' provides no library or the Library key is missing", service.entryPath());
209 kDebug(kLibraryDebugArea()) << "Expected a KPluginFactory, got a" << obj->metaObject()->className();
236 d->verificationData = (KDEPluginVerificationData *) lib.resolve("kde_plugin_verification_data");
239 || ((d->verificationData->KDEVersion & 0xFFFF00) > (KDE_VERSION & 0xFFFF00)) // newer minor version
240 || (KDE_VERSION_MAJOR << 16 != (d->verificationData->KDEVersion & 0xFF0000))) // different major version
242 d->errorString = i18n("The plugin '%1' uses an incompatible KDE library (%2).", d->name, QString::fromLatin1(d->verificationData->KDEVersionString));
247 kDebug(kLibraryDebugArea()) << "The plugin" << d->name << "doesn't contain a kde_plugin_verification_data structure";
QString i18n(const char *text)
Returns a localized version of a string.
Definition: klocalizedstring.h:630
bool load()
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
QString path() const
QString pluginName() const
The name of this plugin as given to the constructor.
Represent a service, like an application or plugin bound to one or several mimetypes (or servicetypes...
Definition: kservice.h:58
virtual const QMetaObject * metaObject() const
const KAboutData * aboutData() const
Returns the about data of this component.
Definition: kcomponentdata.cpp:215
Definition: kexportplugin.h:32
QString fileName() const
bool unload()
int lastIndexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
This class can be used to dynamically load a plugin library at runtime.
Definition: kpluginloader.h:79
QString fileName() const
KPluginLoader(const QString &plugin, const KComponentData &componentdata=KGlobal::mainComponent(), QObject *parent=0)
Used this constructor to load a plugin with a given library name.
Definition: kpluginloader.cpp:133
bool isEmpty() const
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
QObject * instance()
Thin wrapper around QLibrary; you should rarely use this directly, see KPluginLoader for higher-level...
Definition: klibrary.h:38
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
QString errorString() const
bool isLoaded() const
const char * className() const
bool isRelativePath(const QString &path)
KPluginFactory * factory()
Used to obtain the factory object of the plugin.
Definition: kpluginloader.cpp:185
void * resolve(const char *symbol)
unsigned int version()
Returns the encoded number of KDE's version, see the KDE_VERSION macro.
Definition: kdeversion.cpp:24
QString findResource(const char *type, const QString &filename) const
Tries to find a resource in the following order:
Definition: kstandarddirs.cpp:458
QString fromLatin1(const char *str, int size)
QString findLibraryInternal(const QString &name, const KComponentData &cData)
Definition: kpluginloader.cpp:83
bool isLoaded() const
If you develop a library that is to be loaded dynamically at runtime, then you should return a pointe...
Definition: kpluginfactory.h:232
bool isLibrary(const QString &fileName)
KStandardDirs * dirs() const
Returns the application standard dirs object.
Definition: kcomponentdata.cpp:193
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.