diff --git a/applet.cpp b/applet.cpp index 39aeaf949..ecb4aefa9 100644 --- a/applet.cpp +++ b/applet.cpp @@ -667,10 +667,10 @@ void Applet::updateConstraints(Plasma::Constraints constraints) d->scheduleConstraintsUpdate(constraints, this); } -void Applet::constraintsUpdated(Plasma::Constraints constraints) +void Applet::constraintsEvent(Plasma::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 constraintsUpdated + // as it will not get called for any applet that reimplements constraintsEvent // without calling the Applet:: version as well, which it shouldn't need to. // INSTEAD put such code into flushPendingConstraintsEvents Q_UNUSED(constraints) @@ -972,7 +972,7 @@ void Applet::flushPendingConstraintsEvents() containment->d->containmentConstraintsUpdated(c); } - constraintsUpdated(c); + constraintsEvent(c); if (layout()) { layout()->updateGeometry(); diff --git a/applet.h b/applet.h index 1a8eb4b80..9daab6714 100644 --- a/applet.h +++ b/applet.h @@ -199,27 +199,13 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget /** * Called when any of the geometry constraints have been updated. - * This method calls constraintsUpdated, which may be reimplemented, + * This method calls constraintsEvent, which may be reimplemented, * once the Applet has been prepared for updating the constraints. * * @param constraints the type of constraints that were updated */ void updateConstraints(Plasma::Constraints constraints = Plasma::AllConstraints); - /** - * Called when any of the geometry constraints have been updated. - * - * This is always called prior to painting and should be used as an - * opportunity to layout the widget, calculate sizings, etc. - * - * Do not call update() from this method; an update() will be triggered - * at the appropriate time for the applet. - * - * @param constraints the type of constraints that were updated - * @property constraint - */ - virtual void constraintsUpdated(Plasma::Constraints constraints); - /** * Returns the current form factor the applet is being displayed in. * @@ -646,6 +632,20 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget */ void setActAsContainment(bool actAsContainment); + /** + * Called when any of the geometry constraints have been updated. + * + * This is always called prior to painting and should be used as an + * opportunity to layout the widget, calculate sizings, etc. + * + * Do not call update() from this method; an update() will be triggered + * at the appropriate time for the applet. + * + * @param constraints the type of constraints that were updated + * @property constraint + */ + virtual void constraintsEvent(Plasma::Constraints constraints); + /** * Sets the BackgroundHints for this applet @see BackgroundHint * diff --git a/applethandle.cpp b/applethandle.cpp index 70af3cde5..3c17f9532 100644 --- a/applethandle.cpp +++ b/applethandle.cpp @@ -538,7 +538,7 @@ void AppletHandle::switchContainment(Containment *containment, const QPointF &po QVariant AppletHandle::itemChange(GraphicsItemChange change, const QVariant &value) { if (change == ItemPositionHasChanged && m_applet) { - m_applet->constraintsUpdated(Plasma::LocationConstraint); + m_applet->updateConstraints(Plasma::LocationConstraint); } return QGraphicsItem::itemChange(change, value); } diff --git a/containment.cpp b/containment.cpp index bc256062a..43943abca 100644 --- a/containment.cpp +++ b/containment.cpp @@ -980,7 +980,7 @@ void Containment::Private::containmentConstraintsUpdated(Plasma::Constraints con // tell the applets too foreach (Applet *a, applets) { - a->constraintsUpdated(ImmutableConstraint); + a->constraintsEvent(ImmutableConstraint); } }