From b49680140c10f46540d1c304eb4ab3103260b533 Mon Sep 17 00:00:00 2001 From: Matt Broadstone Date: Wed, 28 Feb 2007 23:35:26 +0000 Subject: [PATCH] Get things actually building here svn path=/trunk/KDE/kdebase/workspace/plasma/lib/; revision=638147 --- CMakeLists.txt | 5 ++- dataengine.cpp | 105 +++++++++++++++++++++++++++++++++++++++++++++++-- dataengine.h | 6 ++- interface.cpp | 38 ++++++++++++++++-- interface.h | 16 ++++++-- 5 files changed, 154 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20348dd79..3ae104902 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,4 @@ - - +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) ########### next target ############### @@ -9,6 +8,7 @@ set(plasma_LIB_SRCS interface.cpp runner.cpp theme.cpp + dataengine.cpp ) kde4_automoc(${plasma_LIB_SRCS}) @@ -29,5 +29,6 @@ install( FILES runner.h theme.h interface.h + dataengine.h DESTINATION ${INCLUDE_INSTALL_DIR}/plasma ) diff --git a/dataengine.cpp b/dataengine.cpp index 03c2936d2..9f10e2d24 100644 --- a/dataengine.cpp +++ b/dataengine.cpp @@ -16,27 +16,124 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + #include "dataengine.h" +#include "dataengine.moc" + +using namespace Plasma; class DataSource::Private { public: - Private(); + Private() {} + ~Private() {} }; -DataSource(QObject* parent) +DataSource::DataSource(QObject* parent) : QObject(parent) { d = new Private(); } -virtual ~DataSource() +DataSource::~DataSource() { delete d; } -QString name() +QString DataSource::name() { + kDebug() << k_funcinfo << " not implemented"; + return QString(); +} + + + + + + +DataEngine::DataEngine(QObject* parent) + : QObject(parent) +{ +} + +DataEngine::~DataEngine() +{ +} + +QStringList DataEngine::dataSources() +{ + kDebug() << k_funcinfo << " not implemented"; + return QStringList(); +} + +void DataEngine::connect(const QString& source, DataVisualization* visualization) +{ + Q_UNUSED(source) + Q_UNUSED(visualization) + + kDebug() << k_funcinfo << " not implemented"; +} + +DataSource::Data DataEngine::query(const QString& source) +{ + Q_UNUSED(source) + + kDebug() << k_funcinfo << " not implemented"; +} + +void DataEngine::init() +{ + kDebug() << k_funcinfo << " not implemented"; +} + +void DataEngine::cleanup() +{ + kDebug() << k_funcinfo << " not implemented"; +} + +void DataEngine::setDataSource(const QString& source, const QVariant& value) +{ + Q_UNUSED(source) + Q_UNUSED(value) + + kDebug() << k_funcinfo << " not implemented"; +} + +void DataEngine::createDataSource(const QString& source, const QString& domain) +{ + Q_UNUSED(source) + Q_UNUSED(domain) + + kDebug() << k_funcinfo << " not implemented"; +} + +void DataEngine::removeDataSource(const QString& source) +{ + Q_UNUSED(source) + + kDebug() << k_funcinfo << " not implemented"; +} + +void DataEngine::clearAllDataSources() +{ + kDebug() << k_funcinfo << " not implemented"; +} + +void DataEngine::ref() +{ + kDebug() << k_funcinfo << " not implemented"; +} + +void DataEngine::deref() +{ + kDebug() << k_funcinfo << " not implemented"; +} + +bool DataEngine::isUsed() +{ + kDebug() << k_funcinfo << " not implemented"; + return false; } diff --git a/dataengine.h b/dataengine.h index 98539b382..2d25fea64 100644 --- a/dataengine.h +++ b/dataengine.h @@ -24,13 +24,15 @@ #include #include +#include + namespace Plasma { class DataSource; class DataVisualization; -class DataSource : public QObject +class KDE_EXPORT DataSource : public QObject { Q_OBJECT @@ -51,7 +53,7 @@ class DataSource : public QObject Private* d; }; -class DataEngine : public QObject +class KDE_EXPORT DataEngine : public QObject { Q_OBJECT diff --git a/interface.cpp b/interface.cpp index 0bd200267..74656ee6e 100644 --- a/interface.cpp +++ b/interface.cpp @@ -16,14 +16,44 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + #include "interface.h" namespace Plasma { -Interface* Interface::m_interface; -Interface::Interface() {} -Interface::~Interface() {} +Interface* Interface::m_interface = 0; -} // Plasma namespace +Interface *Interface::self() +{ + if (!m_interface) + m_interface = new Interface; + return m_interface; +} + +Interface::Interface() +{ +} + +Interface::~Interface() +{ +} + +bool loadDataEngine(const QString& name) +{ + Q_UNUSED(name) + + kDebug() << k_funcinfo << " not implemented"; + return false; +} + +void unloadDataEngine(const QString& name) +{ + Q_UNUSED(name) + + kDebug() << k_funcinfo << " not implemented"; +} + +} diff --git a/interface.h b/interface.h index 0a876dfaf..93e78b9c4 100644 --- a/interface.h +++ b/interface.h @@ -21,20 +21,28 @@ #include +#include + namespace Plasma { -class Interface +class KDE_EXPORT Interface { public: - static Interface* self() { return m_interface; } + // NOTE: Fix this stuff, not sure what the design was supposed to be, + // but, this thing can't be a singleton because we can't create + // an Interface object due to the pure virtuals. Maybe make them + // just virtual? -MB - virtual bool loadDataEngine(const QString& name) = 0; - virtual void unloadDataEngine(const QString& name) = 0; + static Interface* self(); + + virtual bool loadDataEngine(const QString &name); + virtual void unloadDataEngine(const QString &name); protected: Interface(); virtual ~Interface(); + static Interface* m_interface; };