From ad2fe77745bd842801bfc1cb4cb52fc7c2e85482 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 14 May 2013 18:08:58 +0200 Subject: [PATCH] get rid of Plasma::Constraint --- src/plasma/applet.cpp | 6 +++--- src/plasma/applet.h | 4 ++-- src/plasma/plasma.h | 4 ++-- src/plasma/private/applet_p.cpp | 2 +- src/plasma/private/applet_p.h | 4 ++-- src/plasma/private/containment_p.cpp | 4 ++-- src/plasma/private/containment_p.h | 2 +- src/plasma/scripting/appletscript.cpp | 2 +- src/plasma/scripting/appletscript.h | 2 +- src/scriptengines/qml/plasmoid/declarativeappletscript.cpp | 2 +- src/scriptengines/qml/plasmoid/declarativeappletscript.h | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/plasma/applet.cpp b/src/plasma/applet.cpp index 659dd7baa..c477497a4 100644 --- a/src/plasma/applet.cpp +++ b/src/plasma/applet.cpp @@ -293,12 +293,12 @@ Package Applet::package() const return d->package ? *d->package : Package(); } -void Applet::updateConstraints(Plasma::Constraints constraints) +void Applet::updateConstraints(Plasma::Types::Constraints constraints) { d->scheduleConstraintsUpdate(constraints); } -void Applet::constraintsEvent(Plasma::Constraints constraints) +void Applet::constraintsEvent(Plasma::Types::Constraints constraints) { //NOTE: do NOT put any code in here that reacts to constraints updates // as it will not get called for any applet that reimplements constraintsEvent @@ -431,7 +431,7 @@ void Applet::flushPendingConstraintsEvents() } //kDebug() << "fushing constraints: " << d->pendingConstraints << "!!!!!!!!!!!!!!!!!!!!!!!!!!!"; - Plasma::Constraints c = d->pendingConstraints; + Plasma::Types::Constraints c = d->pendingConstraints; d->pendingConstraints = Types::NoConstraint; if (c & Plasma::Types::StartupCompletedConstraint) { diff --git a/src/plasma/applet.h b/src/plasma/applet.h index 168da3dce..24d200e62 100644 --- a/src/plasma/applet.h +++ b/src/plasma/applet.h @@ -225,7 +225,7 @@ class PLASMA_EXPORT Applet : public QObject * * @param constraints the type of constraints that were updated */ - void updateConstraints(Plasma::Constraints constraints = Plasma::Types::AllConstraints); + void updateConstraints(Plasma::Types::Constraints constraints = Plasma::Types::AllConstraints); //METADATA @@ -546,7 +546,7 @@ class PLASMA_EXPORT Applet : public QObject * @param constraints the type of constraints that were updated * @property constraint */ - virtual void constraintsEvent(Plasma::Constraints constraints); + virtual void constraintsEvent(Plasma::Types::Constraints constraints); //TODO: timerEvent should go into AppletPrivate /** diff --git a/src/plasma/plasma.h b/src/plasma/plasma.h index a0fb4163c..f3613cc8e 100644 --- a/src/plasma/plasma.h +++ b/src/plasma/plasma.h @@ -299,8 +299,8 @@ PLASMA_EXPORT Types::Direction locationToInverseDirection(Types::Location locati //For porting //TODO: remove -typedef Types::Constraint Constraint; -Q_DECLARE_FLAGS(Constraints, Constraint) +//typedef Types::Constraint Constraint; +//Q_DECLARE_FLAGS(Constraints, Constraint) typedef Types::FormFactor FormFactor; typedef Types::ContainmentType ContainmentType; typedef Types::ActionType ActionType; diff --git a/src/plasma/private/applet_p.cpp b/src/plasma/private/applet_p.cpp index b557fb978..f7b982e7c 100644 --- a/src/plasma/private/applet_p.cpp +++ b/src/plasma/private/applet_p.cpp @@ -317,7 +317,7 @@ QString AppletPrivate::globalName() const return appletDescription.service()->library(); } -void AppletPrivate::scheduleConstraintsUpdate(Plasma::Constraints c) +void AppletPrivate::scheduleConstraintsUpdate(Plasma::Types::Constraints c) { // Don't start up a timer if we're just starting up // flushPendingConstraints will be called by Corona diff --git a/src/plasma/private/applet_p.h b/src/plasma/private/applet_p.h index af0a42791..0ffa80a6c 100644 --- a/src/plasma/private/applet_p.h +++ b/src/plasma/private/applet_p.h @@ -62,7 +62,7 @@ public: void setIsContainment(bool isContainment, bool forceUpdate = false); QString globalName() const; - void scheduleConstraintsUpdate(Plasma::Constraints c); + void scheduleConstraintsUpdate(Plasma::Types::Constraints c); void scheduleModificationNotification(); KConfigGroup *mainConfigGroup(); void resetConfigurationObject(); @@ -89,7 +89,7 @@ public: // bookkeeping KConfigGroup *mainConfig; - Plasma::Constraints pendingConstraints; + Plasma::Types::Constraints pendingConstraints; // sripting and package stuff AppletScript *script; diff --git a/src/plasma/private/containment_p.cpp b/src/plasma/private/containment_p.cpp index aeca2c37e..03e950d61 100644 --- a/src/plasma/private/containment_p.cpp +++ b/src/plasma/private/containment_p.cpp @@ -187,7 +187,7 @@ void ContainmentPrivate::triggerShowAddWidgets() emit q->showAddWidgetsInterface(QPointF()); } -void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constraints) +void ContainmentPrivate::containmentConstraintsEvent(Plasma::Types::Constraints constraints) { if (!q->isContainment()) { return; @@ -218,7 +218,7 @@ void ContainmentPrivate::containmentConstraintsEvent(Plasma::Constraints constra } // pass on the constraints that are relevant here - Constraints appletConstraints = Types::NoConstraint; + Types::Constraints appletConstraints = Types::NoConstraint; if (constraints & Types::FormFactorConstraint) { appletConstraints |= Types::FormFactorConstraint; } diff --git a/src/plasma/private/containment_p.h b/src/plasma/private/containment_p.h index 889388ce0..7e681160d 100644 --- a/src/plasma/private/containment_p.h +++ b/src/plasma/private/containment_p.h @@ -73,7 +73,7 @@ public: * constraint services common to all containments. Containments should still * implement their own constraintsEvent method */ - void containmentConstraintsEvent(Plasma::Constraints constraints); + void containmentConstraintsEvent(Plasma::Types::Constraints constraints); bool isPanelContainment() const; void setLockToolText(); diff --git a/src/plasma/scripting/appletscript.cpp b/src/plasma/scripting/appletscript.cpp index 4702b05cf..675bd199f 100644 --- a/src/plasma/scripting/appletscript.cpp +++ b/src/plasma/scripting/appletscript.cpp @@ -66,7 +66,7 @@ void AppletScript::paintInterface(QPainter *painter, Q_UNUSED(contentsRect); } -void AppletScript::constraintsEvent(Plasma::Constraints constraints) +void AppletScript::constraintsEvent(Plasma::Types::Constraints constraints) { Q_UNUSED(constraints); } diff --git a/src/plasma/scripting/appletscript.h b/src/plasma/scripting/appletscript.h index 74559ac75..09d36c6ce 100644 --- a/src/plasma/scripting/appletscript.h +++ b/src/plasma/scripting/appletscript.h @@ -94,7 +94,7 @@ public: * * @param constraints the type of constraints that were updated */ - virtual void constraintsEvent(Plasma::Constraints constraints); + virtual void constraintsEvent(Plasma::Types::Constraints constraints); /** * Returns a list of context-related QAction instances. diff --git a/src/scriptengines/qml/plasmoid/declarativeappletscript.cpp b/src/scriptengines/qml/plasmoid/declarativeappletscript.cpp index 0a4335e54..2570833e1 100644 --- a/src/scriptengines/qml/plasmoid/declarativeappletscript.cpp +++ b/src/scriptengines/qml/plasmoid/declarativeappletscript.cpp @@ -129,7 +129,7 @@ QObject *DeclarativeAppletScript::loadui(const QString &filename) } -void DeclarativeAppletScript::constraintsEvent(Plasma::Constraints constraints) +void DeclarativeAppletScript::constraintsEvent(Plasma::Types::Constraints constraints) { if (constraints & Plasma::Types::FormFactorConstraint) { emit formFactorChanged(); diff --git a/src/scriptengines/qml/plasmoid/declarativeappletscript.h b/src/scriptengines/qml/plasmoid/declarativeappletscript.h index 3473ab889..b26a56d48 100644 --- a/src/scriptengines/qml/plasmoid/declarativeappletscript.h +++ b/src/scriptengines/qml/plasmoid/declarativeappletscript.h @@ -43,7 +43,7 @@ public: QList contextualActions(); - void constraintsEvent(Plasma::Constraints constraints); + void constraintsEvent(Plasma::Types::Constraints constraints); bool include(const QString &path);