From f9adc7a598b719faeb6bf256502bc998bd4f256e Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 4 Apr 2013 18:07:18 +0200 Subject: [PATCH] remove DataEngine::init() with only one ctor is not necessary anymore --- src/plasma/dataengine.cpp | 20 ++++++++------------ src/plasma/dataengine.h | 11 ----------- src/plasma/private/dataenginemanager.cpp | 1 - 3 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/plasma/dataengine.cpp b/src/plasma/dataengine.cpp index d5093687c..a6ddbe294 100644 --- a/src/plasma/dataengine.cpp +++ b/src/plasma/dataengine.cpp @@ -52,6 +52,14 @@ DataEngine::DataEngine(const KPluginInfo &plugin, QObject *parent) : QObject(parent), d(new DataEnginePrivate(this, plugin)) { + if (d->script) { + d->setupScriptSupport(); + d->script->init(); + } else { + // kDebug() << "called"; + // default implementation does nothing. this is for engines that have to + // start things in motion external to themselves before they can work + } } DataEngine::~DataEngine() @@ -130,18 +138,6 @@ DataContainer *DataEngine::containerForSource(const QString &source) return d->source(source, false); } -void DataEngine::init() -{ - if (d->script) { - d->setupScriptSupport(); - d->script->init(); - } else { - // kDebug() << "called"; - // default implementation does nothing. this is for engines that have to - // start things in motion external to themselves before they can work - } -} - bool DataEngine::sourceRequestEvent(const QString &name) { if (d->script) { diff --git a/src/plasma/dataengine.h b/src/plasma/dataengine.h index d38edd09a..d6cbb6402 100644 --- a/src/plasma/dataengine.h +++ b/src/plasma/dataengine.h @@ -75,17 +75,6 @@ class PLASMA_EXPORT DataEngine : public QObject ~DataEngine(); - /** - * This method is called when the DataEngine is started. When this - * method is called the DataEngine is fully constructed and ready to be - * used. This method should be reimplemented by DataEngine subclasses - * which need to perform a startup routine. - * - * The default implementation does nothing. Reimplementations in - * subclasses don't need to call this one. - **/ - virtual void init(); - /** * @return a list of all the data sources available via this DataEngine * Whether these sources are currently available (which is what diff --git a/src/plasma/private/dataenginemanager.cpp b/src/plasma/private/dataenginemanager.cpp index 0c11b1544..7e3c5287a 100644 --- a/src/plasma/private/dataenginemanager.cpp +++ b/src/plasma/private/dataenginemanager.cpp @@ -138,7 +138,6 @@ Plasma::DataEngine *DataEngineManager::loadEngine(const QString &name) return d->nullEngine(); } - engine->init(); d->engines[name] = engine; return engine; }