From fd71ff404b295c8709b24dec603bf1be939a045c Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Thu, 15 Jul 2010 21:11:20 +0000 Subject: [PATCH] * loadEngine -> loadDataEngine * ws clean up * add to the apidox a bit * add a ctor svn path=/trunk/KDE/kdelibs/; revision=1150391 --- dataenginemanager.cpp | 2 +- pluginloader.cpp | 13 +++++++------ pluginloader.h | 20 ++++++++++++-------- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/dataenginemanager.cpp b/dataenginemanager.cpp index f4c2f126b..6b82934b4 100644 --- a/dataenginemanager.cpp +++ b/dataenginemanager.cpp @@ -117,7 +117,7 @@ Plasma::DataEngine *DataEngineManager::loadEngine(const QString &name) // Ask the application's plugin loader, if present if (PluginLoader::pluginLoader()) { - engine = PluginLoader::pluginLoader()->loadEngine(name); + engine = PluginLoader::pluginLoader()->loadDataEngine(name); if (engine) { return engine; } diff --git a/pluginloader.cpp b/pluginloader.cpp index d33125d5e..a050bf18c 100644 --- a/pluginloader.cpp +++ b/pluginloader.cpp @@ -23,15 +23,16 @@ namespace Plasma { -class PluginLoaderPrivate -{ - // Placeholder for BC -}; - static PluginLoader* s_pluginLoader = 0; +PluginLoader::PluginLoader() + : d(0) +{ +} + PluginLoader::~PluginLoader() { + //delete d; } void PluginLoader::setPluginLoader(PluginLoader* loader) @@ -52,7 +53,7 @@ Applet* PluginLoader::loadApplet(const QString &name, uint appletId, const QVari { Q_UNUSED(name) Q_UNUSED(appletId) Q_UNUSED(args) return 0; } -DataEngine* PluginLoader::loadEngine(const QString &name) +DataEngine* PluginLoader::loadDataEngine(const QString &name) { Q_UNUSED(name) return 0; } diff --git a/pluginloader.h b/pluginloader.h index b570ab69b..f23b7c691 100644 --- a/pluginloader.h +++ b/pluginloader.h @@ -32,7 +32,9 @@ class PluginLoaderPrivate; /** * This is an abstract base class which defines an interface to which Plasma's - * Applet Loading logic can communicate with a parent application. + * Applet Loading logic can communicate with a parent application. The plugin loader + * must be set before any plugins are loaded, otherwise (for safety reasons), the + * default PluginLoader implementation will be used. * * @author Ryan Rix * @since 4.6 @@ -40,8 +42,10 @@ class PluginLoaderPrivate; class PLASMA_EXPORT PluginLoader { public: + PluginLoader(); + virtual ~PluginLoader(); - + /** * Load an external applet and supply it to Plasma. * @@ -53,15 +57,15 @@ public: **/ virtual Applet* loadApplet(const QString &name, uint appletId = 0, const QVariantList &args = QVariantList()); - + /** * Load an external DataEngine and supply it to Plasma. * * @param name the name of the engine * @return the data engine that was loaded, or the NullEngine on failure. **/ - virtual DataEngine* loadEngine(const QString &name); - + virtual DataEngine* loadDataEngine(const QString &name); + /** * Load an external Service and supply it to Plasma. * @@ -72,7 +76,7 @@ public: * @return a Service object, unlike Plasma::Service::loadService, this can return null. **/ virtual Service* loadService(const QString &name, const QVariantList &args, QObject *parent = 0); - + /** * Set the plugin loader which will be queried for all loads. * @@ -80,14 +84,14 @@ public: * by the application **/ static void setPluginLoader(PluginLoader* loader); - + /** * Return the active plugin loader **/ static PluginLoader* pluginLoader(); private: - PluginLoaderPrivate* d; + PluginLoaderPrivate * const d; }; }