diff --git a/CMakeLists.txt b/CMakeLists.txt index 47e6a3a79..955184829 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,8 @@ set(plasma_LIB_SRCS dataenginemanager.cpp delegate.cpp dialog.cpp + extender.cpp + extenderitem.cpp paintutils.cpp panelsvg.cpp plasma.cpp @@ -63,8 +65,6 @@ set(plasma_LIB_SRCS view.cpp widgets/checkbox.cpp widgets/combobox.cpp - widgets/extender.cpp - widgets/extenderitem.cpp widgets/flash.cpp widgets/frame.cpp widgets/groupbox.cpp @@ -135,6 +135,8 @@ set(plasma_LIB_INCLUDES dataenginemanager.h delegate.h dialog.h + extender.h + extenderitem.h paintutils.h panelsvg.h plasma.h @@ -166,8 +168,6 @@ install(FILES install(FILES widgets/checkbox.h widgets/combobox.h - widgets/extender.h - widgets/extenderitem.h widgets/flash.h widgets/frame.h widgets/groupbox.h diff --git a/applet.cpp b/applet.cpp index d26774292..49db9327a 100644 --- a/applet.cpp +++ b/applet.cpp @@ -63,6 +63,8 @@ #include "containment.h" #include "corona.h" #include "dataenginemanager.h" +#include "extender.h" +#include "extenderitem.h" #include "package.h" #include "plasma.h" #include "scripting/appletscript.h" @@ -72,8 +74,6 @@ #include "view.h" #include "widgets/label.h" #include "widgets/pushbutton.h" -#include "widgets/extender.h" -#include "widgets/extenderitem.h" #include "tooltipmanager.h" #include "private/containment_p.h" diff --git a/applet.h b/applet.h index d7f205177..a7927362a 100644 --- a/applet.h +++ b/applet.h @@ -44,12 +44,12 @@ class KActionCollection; namespace Plasma { +class AppletPrivate; class Containment; class DataEngine; -class Package; -class AppletPrivate; -class ExtenderItem; class Extender; +class ExtenderItem; +class Package; /** * @short The base Applet class diff --git a/containment.cpp b/containment.cpp index 8df1f714f..f551ee7a1 100644 --- a/containment.cpp +++ b/containment.cpp @@ -523,10 +523,6 @@ Applet* Containment::addApplet(const QString& name, const QVariantList& args, co return d->addApplet(name, args, appletGeometry); } -//pos must be relative to the containment already. use mapfromscene. -//what we're trying to do here for panels is make the applet go to the requested position, -//or somewhere close to it, and get integrated properly into the containment as if it were created -//there. void Containment::addApplet(Applet *applet, const QPointF &pos, bool delayInit) { if (!delayInit && immutability() != Mutable) { diff --git a/datacontainer.h b/datacontainer.h index 8fec0af7d..5ccfcf32e 100644 --- a/datacontainer.h +++ b/datacontainer.h @@ -95,7 +95,6 @@ class PLASMA_EXPORT DataContainer : public QObject void connectVisualization(QObject* visualization, uint pollingInterval, Plasma::IntervalAlignment alignment); public Q_SLOTS: - /** * Disconnects an object from this DataContainer. **/ @@ -118,6 +117,7 @@ class PLASMA_EXPORT DataContainer : public QObject * requests to be updated. **/ void updateRequested(DataContainer *source); + protected: /** * Checks for whether the data has changed and therefore an update @@ -148,7 +148,6 @@ protected Q_SLOTS: */ void checkUsage(); - private: friend class SignalRelay; DataContainerPrivate* const d; diff --git a/dataengine.h b/dataengine.h index 9e9751cd4..10617f713 100644 --- a/dataengine.h +++ b/dataengine.h @@ -55,11 +55,6 @@ class DataEnginePrivate; **/ class PLASMA_EXPORT DataEngine : public QObject { - friend class DataEnginePrivate; - friend class DataEngineScript; - friend class DataEngineManager; - friend class NullEngine; - Q_OBJECT Q_PROPERTY( QStringList sources READ sources ) Q_PROPERTY( bool valid READ isValid ) @@ -424,6 +419,11 @@ class PLASMA_EXPORT DataEngine : public QObject void removeSource(const QString& source); private: + friend class DataEnginePrivate; + friend class DataEngineScript; + friend class DataEngineManager; + friend class NullEngine; + Q_PRIVATE_SLOT(d, void internalUpdateSource(DataContainer* source)) DataEnginePrivate* const d; diff --git a/widgets/extender.cpp b/extender.cpp similarity index 98% rename from widgets/extender.cpp rename to extender.cpp index 9b58e0502..5340cc8ed 100644 --- a/widgets/extender.cpp +++ b/extender.cpp @@ -17,19 +17,20 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ -#include "extender_p.h" #include "extender.h" -#include -#include #include +#include +#include -#include "plasma/applet.h" -#include "plasma/private/applet_p.h" -#include "plasma/containment.h" -#include "plasma/corona.h" -#include "plasma/widgets/extenderitem.h" -#include "plasma/widgets/label.h" +#include "applet.h" +#include "containment.h" +#include "corona.h" +#include "extenderitem.h" +#include "widgets/label.h" + +#include "private/applet_p.h" +#include "private/extender_p.h" namespace Plasma { diff --git a/widgets/extender.h b/extender.h similarity index 90% rename from widgets/extender.h rename to extender.h index 0f029a469..958408cae 100644 --- a/widgets/extender.h +++ b/extender.h @@ -31,16 +31,18 @@ class ExtenderItem; class Applet; /** - * An extender is a widget where items can be added to. These so called ExtenderItems can be - * detached by the user an dropped in other extenders or somewhere else, in which case a new - * extenderapplet is created and the item is added there. - * This widget allows using ExtenderItems in you applet. Extender takes care of the presentation - * of a collection of extenderitems, and keeps track of extenderItems that originated in it. - * This default extender displays extender items in a vertical layout, and shows spacers in this - * layout when hovering with an extender item over it, which is probably good for most cases. + * An Extender is a widget that visually extends the normal contents of an applet with + * additional dynamic widgets called ExtenderItems. These ExtenderItems can be + * detached by the user and dropped either on another Extender or on the canvas directly. + * + * This widget allows using ExtenderItems in your applet. Extender takes care of the presentation + * of a collection of ExtenderItems and keeps track of ExtenderItems that originate in it. + * + * The default Extender implementation displays extender items in a vertical layout with + * spacers that appear when dropping an ExtenderItem over it. + * * If you wish to have a different presentation of extender items, you can choose to subclass - * this class. In this case you'll need to reimplement the extenderItem* events and optionally - * the saveState function. + * Extender and reimplement the extenderItem* events and, optionally, the saveState function. */ class PLASMA_EXPORT Extender : public QGraphicsWidget { @@ -175,3 +177,4 @@ class PLASMA_EXPORT Extender : public QGraphicsWidget } // Plasma namespace #endif //EXTENDER_H + diff --git a/widgets/extenderitem.cpp b/extenderitem.cpp similarity index 98% rename from widgets/extenderitem.cpp rename to extenderitem.cpp index 1bf868958..fad3c0463 100644 --- a/widgets/extenderitem.cpp +++ b/extenderitem.cpp @@ -19,27 +19,28 @@ #include "extenderitem.h" -#include -#include -#include -#include #include #include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include -#include "plasma/corona.h" -#include "plasma/containment.h" -#include "plasma/theme.h" -#include "plasma/view.h" -#include "plasma/applet.h" -#include "plasma/private/applet_p.h" -#include "plasma/panelsvg.h" -#include "plasma/widgets/extender.h" -#include "plasma/widgets/extender_p.h" +#include "applet.h" +#include "containment.h" +#include "corona.h" +#include "extender.h" +#include "panelsvg.h" +#include "theme.h" +#include "view.h" + +#include "private/applet_p.h" +#include "private/extender_p.h" namespace Plasma { diff --git a/widgets/extenderitem.h b/extenderitem.h similarity index 100% rename from widgets/extenderitem.h rename to extenderitem.h diff --git a/includes/Extender b/includes/Extender index cfb614a21..e7477770b 100644 --- a/includes/Extender +++ b/includes/Extender @@ -1,2 +1,2 @@ -#include "../../plasma/widgets/extender.h" +#include "../../plasma/extender.h" diff --git a/includes/ExtenderItem b/includes/ExtenderItem index 8a29cdd35..8155922e3 100644 --- a/includes/ExtenderItem +++ b/includes/ExtenderItem @@ -1,2 +1,2 @@ -#include "../../plasma/widgets/extenderitem.h" +#include "../../plasma/extenderitem.h" diff --git a/widgets/extender_p.h b/private/extender_p.h similarity index 100% rename from widgets/extender_p.h rename to private/extender_p.h diff --git a/widgets/extenderitem_p.h b/private/extenderitem_p.h similarity index 100% rename from widgets/extenderitem_p.h rename to private/extenderitem_p.h