diff --git a/CMakeLists.txt b/CMakeLists.txt index fff9d042b..260c74b33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,6 @@ set(plasma_LIB_SRCS dataengine.cpp dataenginemanager.cpp datasource.cpp - datavisualization.cpp plasma.cpp interface.cpp svg.cpp @@ -41,7 +40,6 @@ install( FILES dataengine.h dataenginemanager.h datasource.h - datavisualization.h interface.h plasma.h plasma_export.h @@ -63,7 +61,6 @@ install( FILES includes/DataEngine includes/DataEngineManager includes/DataSource - includes/DataVisualization includes/Svg DESTINATION ${INCLUDE_INSTALL_DIR}/KDE/Plasma ) diff --git a/datavisualization.cpp b/datavisualization.cpp deleted file mode 100644 index e03fc159e..000000000 --- a/datavisualization.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2007 Alexander Wiedenbruch - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License version 2 as - * published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "datavisualization.h" - -namespace Plasma -{ - -class DataVisualization::Private -{ -}; - - -DataVisualization::DataVisualization(QObject *parent) - : QObject(parent), - d(new Private) -{ -} - -DataVisualization::~DataVisualization() -{ - delete d; -} - -} // Plasma namespace - - -#include "datavisualization.moc" - diff --git a/datavisualization.h b/datavisualization.h deleted file mode 100644 index 883cccd28..000000000 --- a/datavisualization.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2006 Aaron Seigo - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License version 2 as - * published by the Free Software Foundation - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef PLASMA_DATAVISUALIZATION_H -#define PLASMA_DATAVISUALIZATION_H - -#include - -#include - -namespace Plasma -{ - -// this will end up being multiple-inherited? -class PLASMA_EXPORT DataVisualization : public QObject -{ - Q_OBJECT - public: - DataVisualization(QObject* parent = 0); - virtual ~DataVisualization(); - - public Q_SLOTS: - virtual void updated(const QString& source, const Plasma::DataEngine::Data&) = 0; - - private: - class Private; - Private* const d; -}; - -} // Plasma namespace - -#endif // multiple inclusion guard diff --git a/includes/DataVisualization b/includes/DataVisualization deleted file mode 100644 index 16ec15cf5..000000000 --- a/includes/DataVisualization +++ /dev/null @@ -1 +0,0 @@ -#include "../../plasma/datavisualization.h" diff --git a/widgets/checkbox.cpp b/widgets/checkbox.cpp index 09c044098..c424fa9c9 100644 --- a/widgets/checkbox.cpp +++ b/widgets/checkbox.cpp @@ -24,8 +24,6 @@ #include #include -#include "checkbox.moc" - namespace Plasma { @@ -53,9 +51,9 @@ class CheckBox::Private }; CheckBox::CheckBox(QGraphicsItem *parent) - : DataVisualization(), - QGraphicsItem(parent), - d(new Private) + : QObject(), + QGraphicsItem(parent), + d(new Private) { setAcceptedMouseButtons(Qt::LeftButton); setAcceptsHoverEvents(true); @@ -95,7 +93,7 @@ void CheckBox::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, options.rect = boundingRect().toRect(); options.text = text(); options.state |= (d->state == Qt::Checked)? QStyle::State_On : QStyle::State_Off; - + //if (d->down) { // options.state |= QStyle::State_Sunken; // } @@ -248,3 +246,7 @@ event->accept(); } // namespace Plasma + +#include "checkbox.moc" + + diff --git a/widgets/checkbox.h b/widgets/checkbox.h index 50ab9e1de..7357fdbc8 100644 --- a/widgets/checkbox.h +++ b/widgets/checkbox.h @@ -24,8 +24,7 @@ #include -#include "datavisualization.h" - +#include //TODO //Please Document this class @@ -35,7 +34,7 @@ namespace Plasma /** * Class that emulates a QCheckBox inside plasma */ -class KDE_EXPORT CheckBox : public DataVisualization,public QGraphicsItem +class KDE_EXPORT CheckBox : public QObject, public QGraphicsItem { Q_OBJECT public: diff --git a/widgets/lineedit.h b/widgets/lineedit.h index f469756fb..7fb56dce7 100644 --- a/widgets/lineedit.h +++ b/widgets/lineedit.h @@ -19,11 +19,12 @@ #ifndef LINEEDIT_H #define LINEEDIT_H +#include #include #include -#include "datavisualization.h" +#include namespace Plasma { diff --git a/widgets/pushbutton.cpp b/widgets/pushbutton.cpp index 053dbefb1..33bc4461e 100644 --- a/widgets/pushbutton.cpp +++ b/widgets/pushbutton.cpp @@ -55,9 +55,10 @@ class PushButton::Private }; PushButton::PushButton(QGraphicsItem *parent) - : QGraphicsItem(parent), - QLayoutItem (Qt::AlignHCenter), - d(new Private) + : QObject(), + QGraphicsItem(parent), + QLayoutItem (Qt::AlignHCenter), + d(new Private) { setAcceptedMouseButtons(Qt::LeftButton); setAcceptsHoverEvents(true); diff --git a/widgets/pushbutton.h b/widgets/pushbutton.h index 646dc2c17..6b92e8b58 100644 --- a/widgets/pushbutton.h +++ b/widgets/pushbutton.h @@ -22,9 +22,10 @@ #include #include #include + #include -#include "datavisualization.h" +#include //TODO //Please Document this class @@ -35,11 +36,11 @@ namespace Plasma /** * Class that emulates a QPushButton inside plasma */ -class KDE_EXPORT PushButton : public DataVisualization, +class KDE_EXPORT PushButton : public QObject, public QGraphicsItem, public QLayoutItem { - Q_OBJECT + Q_OBJECT public: enum ButtonShape { @@ -91,7 +92,7 @@ class KDE_EXPORT PushButton : public DataVisualization, void clicked(); public Q_SLOTS: - virtual void updated(const QString&, const DataEngine::Data &); + void updated(const QString&, const DataEngine::Data &); protected: bool isDown(); diff --git a/widgets/radiobutton.cpp b/widgets/radiobutton.cpp index 88583bb88..22852035f 100644 --- a/widgets/radiobutton.cpp +++ b/widgets/radiobutton.cpp @@ -61,9 +61,9 @@ RadioButton::Private::~Private() RadioButton::RadioButton(QGraphicsItem *parent) - : DataVisualization() - , QGraphicsItem(parent) - , d(new Private) + : QObject(), + QGraphicsItem(parent), + d(new Private) { setAcceptedMouseButtons(Qt::LeftButton); setAcceptsHoverEvents(true); diff --git a/widgets/radiobutton.h b/widgets/radiobutton.h index f0c15dc0d..caf90c15c 100644 --- a/widgets/radiobutton.h +++ b/widgets/radiobutton.h @@ -26,14 +26,11 @@ // KDE includes #include -// Plasma includes -#include "datavisualization.h" - +#include namespace Plasma { - /** * This class emulates a QRadioButton. * @@ -50,8 +47,7 @@ namespace Plasma */ -class KDE_EXPORT RadioButton : public DataVisualization - , public QGraphicsItem +class KDE_EXPORT RadioButton : public QObject, public QGraphicsItem { Q_OBJECT @@ -72,7 +68,6 @@ public: void setText(const QString &text); public Q_SLOTS: - // DataVisualization overridden virtual slots void updated(const QString&, const Plasma::DataEngine::Data &data); Q_SIGNALS: diff --git a/widgets/widget.cpp b/widgets/widget.cpp index 557cb290b..c2deab09e 100644 --- a/widgets/widget.cpp +++ b/widgets/widget.cpp @@ -17,13 +17,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "widget.h" -#include "widget.moc" #include #include "layout.h" - +#include "widget.h" namespace Plasma { @@ -43,8 +41,7 @@ class Widget::Private Widget::Widget(Widget *parent) - : DataVisualization(), - QGraphicsItem(parent), + : QGraphicsItem(parent), d(new Private) { d->parent = parent; @@ -52,7 +49,6 @@ Widget::Widget(Widget *parent) if(parent) { parent->addChild(this); - parent->setGeometry(QRectF(QPointF(0.0, 0.0), parent->size())); } } @@ -157,12 +153,6 @@ void Widget::resize(qreal w, qreal h) resize(QSizeF(w, h)); } -void Widget::updated(const QString& source, const Plasma::DataEngine::Data& data) -{ - Q_UNUSED(source); - Q_UNUSED(data); -} - void Widget::setLayout(Layout *l) { d->layout = l; @@ -185,8 +175,6 @@ void Widget::addChild(Widget *w) } w->reparent(this); - w->setParentItem(this); - d->childList.append(w); qDebug("Added Child Widget : %p", (void*)w); @@ -202,7 +190,7 @@ void Widget::addChild(Widget *w) void Widget::reparent(Widget *w) { d->parent = w; - + setParentItem(w); update(); } diff --git a/widgets/widget.h b/widgets/widget.h index 9a85f5178..af692cd4a 100644 --- a/widgets/widget.h +++ b/widgets/widget.h @@ -27,7 +27,6 @@ #include -#include "datavisualization.h" #include "layoutitem.h" namespace Plasma @@ -38,12 +37,8 @@ class Layout; /** * Class that emulates a QWidget inside plasma */ -class KDE_EXPORT Widget : public DataVisualization, - public QGraphicsItem, - public LayoutItem +class KDE_EXPORT Widget : public QGraphicsItem, public LayoutItem { - Q_OBJECT - public: Widget(Widget *parent = 0); virtual ~Widget(); @@ -83,10 +78,6 @@ class KDE_EXPORT Widget : public DataVisualization, void addChild(Widget *w); - public Q_SLOTS: - virtual void updated(const QString& source, const Plasma::DataEngine::Data&); - - private: class Private; Private *const d;