From e3fd26c7bd206d23a02a9458e4f5613dbe5a70fb Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Thu, 24 Aug 2006 22:52:05 +0000 Subject: [PATCH] start moving this towards sensibility not much to see yet, but people are looking at this and understandably scratching their head since it's not obvious that a lot of this was sketching versus implementing... well, that's starting to change. svn path=/trunk/KDE/kdebase/workspace/plasma/lib/; revision=576845 --- applet.cpp | 8 +++----- dataengine.h | 5 +---- interface.h | 4 ++-- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/applet.cpp b/applet.cpp index 32a48ed56..340d2c1ed 100644 --- a/applet.cpp +++ b/applet.cpp @@ -47,7 +47,7 @@ class Applet::Private { foreach (const QString& engine, loadedEngines) { - Interface::interface()->unloadDataEngine(engine); + Interface::self()->unloadDataEngine(engine); } } @@ -88,13 +88,11 @@ KSharedConfig::Ptr Applet::appletConfig() const return d->appletConfig; } -KSharedConfig::Ptr Applet::globalAppletConfig() const +KSharedConfig::Ptr Applet::AppletConfig() const { if (!d->globalConfig) { - QString file = locateLocal("config", - "plasma_" + globalName() + "rc", - true); + QString file = locateLocal("config", "plasma_" + globalName() + "rc"); d->globalConfig = KSharedConfig::openConfig(file, false, true); } diff --git a/dataengine.h b/dataengine.h index fe50a0eda..4dd09ad81 100644 --- a/dataengine.h +++ b/dataengine.h @@ -67,12 +67,11 @@ class DataEngine : public QObject void ref(); void deref(); + bool used(); protected: virtual void init(); virtual void cleanup(); - virtual DataEngine* engine() = 0; - virtual private: QAtomic ref; @@ -89,5 +88,3 @@ class DataEngine : public QObject #endif // multiple inclusion guard - -#endif diff --git a/interface.h b/interface.h index 993a8d0f1..0da758260 100644 --- a/interface.h +++ b/interface.h @@ -25,10 +25,10 @@ namespace Plasma class Interface { public: - static Interface* interface() { return m_interface; } + static Interface* self() { return m_interface; } virtual bool loadDataEngine(const QString& name) = 0; - virtual bool unloadDataEngine(const QString& name) = 0; + virtual void unloadDataEngine(const QString& name) = 0; protected: Interface() : m_interface(0) {}