From 2becd8b67ab31f64c7a001df13fdd7d2165df2cc Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Thu, 9 Feb 2012 15:56:57 +0100 Subject: [PATCH 1/3] apidox++ for Svg signals --- svg.h | 15 +++++++++++++++ theme.h | 8 ++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/svg.h b/svg.h index 9ec92f690..3ed3fa76f 100644 --- a/svg.h +++ b/svg.h @@ -360,7 +360,22 @@ class PLASMA_EXPORT Svg : public QObject Theme *theme() const; Q_SIGNALS: + /** + * Emitted whenever the SVG data has changed in such a way that a repaint is required. + * Any usage of an Svg object that does the painting itself must connect to this signal + * and respond by updating the painting. Note that connected to Theme::themeChanged is + * incorrect in such a use case as the Svg itself may not be updated yet nor may theme + * change be the only case when a repaint is needed. Also note that classes or QML code + * which take Svg objects as parameters for their own painting all respond to this signal + * so that in those cases manually responding to the signal is unnecessary; ONLY when + * direct, manual painting with an Svg object is done in application code is this signal + * used. + */ void repaintNeeded(); + + /** + * Emitted whenever the size of the Svg is changed. @see resize() + */ void sizeChanged(); private: diff --git a/theme.h b/theme.h index 2d0291196..29c81df98 100644 --- a/theme.h +++ b/theme.h @@ -386,8 +386,12 @@ class PLASMA_EXPORT Theme : public QObject Q_SIGNALS: /** - * Emitted when the user changes the theme. SVGs should be reloaded at - * that point + * Emitted when the user changes the theme. Stylesheet usage, colors, etc. should + * be updated at this point. However, SVGs should *not* be repainted in response + * to this signal; connect to Svg::repaintNeeded() instead for that, as Svg objects + * need repainting not only when themeChanged() is emitted; moreover Svg objects + * connect to and respond appropriately to themeChanged() internally, emitting + * Svg::repaintNeeded() at an appropriate time. */ void themeChanged(); From fb0b49af8cc8da49c61309954982473f89ee38fc Mon Sep 17 00:00:00 2001 From: Dawit Alemayehu Date: Sat, 21 Jan 2012 21:11:26 -0500 Subject: [PATCH 2/3] Normalize all signal/slot connections. REVIEW: 103728 --- applet.cpp | 4 ++-- containment.cpp | 4 ++-- datacontainer.cpp | 2 +- dataengine.cpp | 2 +- dataenginemanager.cpp | 2 +- deprecated/animator.cpp | 8 ++++---- extenders/extender.cpp | 4 ++-- private/associatedapplicationmanager.cpp | 2 +- private/kineticscroll.cpp | 8 ++++---- private/qtjolie-branch/qtjolie/serverthread.cpp | 4 ++-- private/qtjolie-branch/tests/calculatorservice.cpp | 4 ++-- private/remoteservice.cpp | 2 +- private/serviceprovider.cpp | 2 +- private/storage.cpp | 2 +- scripting/wallpaperscript.cpp | 8 ++++---- tests/testcontainmentactionsplugin/test.cpp | 2 +- view.cpp | 4 ++-- wallpaper.cpp | 2 +- widgets/combobox.cpp | 6 +++--- widgets/lineedit.cpp | 4 ++-- widgets/videowidget.cpp | 4 ++-- widgets/webview.cpp | 4 ++-- 22 files changed, 42 insertions(+), 42 deletions(-) diff --git a/applet.cpp b/applet.cpp index 6db48dbfb..aeb5cc61d 100644 --- a/applet.cpp +++ b/applet.cpp @@ -1442,8 +1442,8 @@ void Applet::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QW wallpaperConfig = KConfigGroup(&wallpaperConfig, "Wallpaper"); wallpaperConfig = KConfigGroup(&wallpaperConfig, w->pluginName()); w->restore(wallpaperConfig); - disconnect(w, SIGNAL(update(const QRectF&)), this, SLOT(updateRect(const QRectF&))); - connect(w, SIGNAL(update(const QRectF&)), this, SLOT(updateRect(const QRectF&))); + disconnect(w, SIGNAL(update(QRectF)), this, SLOT(updateRect(QRectF))); + connect(w, SIGNAL(update(QRectF)), this, SLOT(updateRect(QRectF))); } painter->save(); diff --git a/containment.cpp b/containment.cpp index 6840b641e..e1895c07d 100644 --- a/containment.cpp +++ b/containment.cpp @@ -1332,8 +1332,8 @@ void ContainmentPrivate::dropData(QPointF scenePos, QPoint screenPos, QGraphicsS } QObject::connect(job, SIGNAL(result(KJob*)), q, SLOT(dropJobResult(KJob*))); - QObject::connect(job, SIGNAL(mimetype(KIO::Job *, const QString&)), - q, SLOT(mimeTypeRetrieved(KIO::Job *, const QString&))); + QObject::connect(job, SIGNAL(mimetype(KIO::Job*,QString)), + q, SLOT(mimeTypeRetrieved(KIO::Job*,QString))); KMenu *choices = new KMenu("Content dropped"); choices->addAction(KIcon("process-working"), i18n("Fetching file type...")); diff --git a/datacontainer.cpp b/datacontainer.cpp index 33d8157ef..fd1ad8991 100644 --- a/datacontainer.cpp +++ b/datacontainer.cpp @@ -337,7 +337,7 @@ void DataContainer::timerEvent(QTimerEvent * event) { if (event->timerId() == d->checkUsageTimer.timerId()) { if (d->relays.count() < 1 && - receivers(SIGNAL(dataUpdated(QString, Plasma::DataEngine::Data))) < 1) { + receivers(SIGNAL(dataUpdated(QString,Plasma::DataEngine::Data))) < 1) { // DO NOT CALL ANYTHING AFTER THIS LINE AS IT MAY GET DELETED! kDebug() << objectName() << "is unused"; emit becameUnused(objectName()); diff --git a/dataengine.cpp b/dataengine.cpp index 259ac2ef9..961257402 100644 --- a/dataengine.cpp +++ b/dataengine.cpp @@ -627,7 +627,7 @@ DataContainer *DataEnginePrivate::source(const QString &sourceName, bool createW DataContainer *s = new DataContainer(q); s->setObjectName(sourceName); sources.insert(sourceName, s); - QObject::connect(s, SIGNAL(destroyed(QObject *)), q, SLOT(sourceDestroyed(QObject *))); + QObject::connect(s, SIGNAL(destroyed(QObject*)), q, SLOT(sourceDestroyed(QObject*))); QObject::connect(s, SIGNAL(updateRequested(DataContainer*)), q, SLOT(internalUpdateSource(DataContainer*))); diff --git a/dataenginemanager.cpp b/dataenginemanager.cpp index 988fe768a..f6dabf074 100644 --- a/dataenginemanager.cpp +++ b/dataenginemanager.cpp @@ -221,7 +221,7 @@ void DataEngineManager::timerEvent(QTimerEvent *) out << " * " << dc->objectName() << endl; out << " Data count: " << dc->d->data.count() << endl; out << " Stored: " << dc->isStorageEnabled() << ' ' << endl; - const int directs = dc->receivers(SIGNAL(dataUpdated(QString, Plasma::DataEngine::Data))); + const int directs = dc->receivers(SIGNAL(dataUpdated(QString,Plasma::DataEngine::Data))); if (directs > 0) { out << " Direction Connections: " << directs << ' ' << endl; } diff --git a/deprecated/animator.cpp b/deprecated/animator.cpp index 03d40d672..4e763bf1c 100644 --- a/deprecated/animator.cpp +++ b/deprecated/animator.cpp @@ -767,8 +767,8 @@ void Animator::registerScrollingManager(QGraphicsWidget *widget) KineticScrolling *scroll = new KineticScrolling(widget); d->scrollingManagers.insert(widget, scroll); connect(scroll, - SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), this, - SLOT(scrollStateChanged(QAbstractAnimation::State, QAbstractAnimation::State))); + SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)), this, + SLOT(scrollStateChanged(QAbstractAnimation::State,QAbstractAnimation::State))); } } @@ -776,8 +776,8 @@ void Animator::unregisterScrollingManager(QGraphicsWidget *widget) { if (d->scrollingManagers.contains(widget)) { disconnect(d->scrollingManagers.value(widget), - SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), this, - SLOT(scrollStateChanged(QAbstractAnimation::State, QAbstractAnimation::State))); + SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)), this, + SLOT(scrollStateChanged(QAbstractAnimation::State,QAbstractAnimation::State))); d->scrollingManagers.value(widget)->deleteLater(); d->scrollingManagers.remove(widget); } diff --git a/extenders/extender.cpp b/extenders/extender.cpp index 74de8c9f7..0d278bc81 100644 --- a/extenders/extender.cpp +++ b/extenders/extender.cpp @@ -111,8 +111,8 @@ Extender::Extender(Applet *applet) d->mainWidget = new QGraphicsWidget(d->scrollWidget); d->scrollWidget->setWidget(d->mainWidget); d->mainWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); - connect(d->scrollWidget, SIGNAL(viewportGeometryChanged(const QRectF &)), - this, SLOT(viewportGeometryChanged(const QRectF &))); + connect(d->scrollWidget, SIGNAL(viewportGeometryChanged(QRectF)), + this, SLOT(viewportGeometryChanged(QRectF))); d->layout = new QGraphicsLinearLayout(d->mainWidget); d->layout->setOrientation(Qt::Vertical); diff --git a/private/associatedapplicationmanager.cpp b/private/associatedapplicationmanager.cpp index 9da0fd2ce..ed309ef6e 100644 --- a/private/associatedapplicationmanager.cpp +++ b/private/associatedapplicationmanager.cpp @@ -92,7 +92,7 @@ void AssociatedApplicationManager::setApplication(Plasma::Applet *applet, const if (service || !KStandardDirs::findExe(application).isNull() || QFile::exists(application)) { d->applicationNames[applet] = application; if (!d->urlLists.contains(applet)) { - connect(applet, SIGNAL(destroyed(QObject *)), this, SLOT(cleanupApplet(QObject *))); + connect(applet, SIGNAL(destroyed(QObject*)), this, SLOT(cleanupApplet(QObject*))); } } } diff --git a/private/kineticscroll.cpp b/private/kineticscroll.cpp index fe162288b..c2ddd7d6b 100644 --- a/private/kineticscroll.cpp +++ b/private/kineticscroll.cpp @@ -349,8 +349,8 @@ void KineticScrolling::setWidget(QGraphicsWidget *parent) d->parent->removeEventFilter(this); disconnect(d->scrollAnimation, SIGNAL(finished()), this, SLOT(overshoot())); disconnect(d->scrollAnimation, - SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), this, - SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State))); + SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)), this, + SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State))); delete d->scrollAnimation; } @@ -361,8 +361,8 @@ void KineticScrolling::setWidget(QGraphicsWidget *parent) d->scrollAnimation = new QPropertyAnimation(parent, "scrollPosition", parent); connect(d->scrollAnimation, SIGNAL(finished()), this, SLOT(overshoot())); connect(d->scrollAnimation, - SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State)), this, - SIGNAL(stateChanged(QAbstractAnimation::State, QAbstractAnimation::State))); + SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)), this, + SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State))); d->scrollAnimation->setEasingCurve(QEasingCurve::OutCirc); if (parent) { diff --git a/private/qtjolie-branch/qtjolie/serverthread.cpp b/private/qtjolie-branch/qtjolie/serverthread.cpp index a609e2f36..d041ca7ca 100644 --- a/private/qtjolie-branch/qtjolie/serverthread.cpp +++ b/private/qtjolie-branch/qtjolie/serverthread.cpp @@ -97,8 +97,8 @@ void ServerThread::run() { m_serverSocket = new QTcpServer; - connect(this, SIGNAL(messageReceived(int, Jolie::Message)), - m_server, SLOT(messageReceived(int, Jolie::Message))); + connect(this, SIGNAL(messageReceived(int,Jolie::Message)), + m_server, SLOT(messageReceived(int,Jolie::Message))); connect(m_serverSocket, SIGNAL(newConnection()), this, SLOT(onIncomingConnection()), Qt::QueuedConnection); diff --git a/private/qtjolie-branch/tests/calculatorservice.cpp b/private/qtjolie-branch/tests/calculatorservice.cpp index 23dd972ee..9ffc1d3e4 100644 --- a/private/qtjolie-branch/tests/calculatorservice.cpp +++ b/private/qtjolie-branch/tests/calculatorservice.cpp @@ -88,8 +88,8 @@ private slots: { m_server = new Server(8000); CalculatorAdaptor *adaptor = new CalculatorAdaptor(this); - connect(adaptor, SIGNAL(added(int, int, int)), - this, SLOT(onAdded(int, int, int))); + connect(adaptor, SIGNAL(added(int,int,int)), + this, SLOT(onAdded(int,int,int))); m_server->registerAdaptor("/", adaptor); m_meta.addRedirection(QString::fromUtf8("Calculator"), diff --git a/private/remoteservice.cpp b/private/remoteservice.cpp index 6c15fd1bc..b96c3ac17 100644 --- a/private/remoteservice.cpp +++ b/private/remoteservice.cpp @@ -245,7 +245,7 @@ ServiceJob* RemoteService::createJob(const QString& operation, } ServiceJob *job = new RemoteServiceJob(m_location, destination(), operation, parameters, m_token, this); - connect(job, SIGNAL(finished(KJob *)), this, SLOT(slotFinished())); + connect(job, SIGNAL(finished(KJob*)), this, SLOT(slotFinished())); return job; } diff --git a/private/serviceprovider.cpp b/private/serviceprovider.cpp index 6f1d90592..bac7d251c 100644 --- a/private/serviceprovider.cpp +++ b/private/serviceprovider.cpp @@ -51,7 +51,7 @@ ServiceProvider::ServiceProvider(const QString &name, Service *service) : Jolie::AbstractAdaptor(service), m_service(service) { - connect(service, SIGNAL(finished(Plasma::ServiceJob *)), + connect(service, SIGNAL(finished(Plasma::ServiceJob*)), this, SLOT(operationCompleted(Plasma::ServiceJob*))); m_providerName = name; diff --git a/private/storage.cpp b/private/storage.cpp index 717a346ae..010387152 100644 --- a/private/storage.cpp +++ b/private/storage.cpp @@ -49,7 +49,7 @@ StorageJob::StorageJob(const QString& destination, m_clientName(destination) { Plasma::StorageThread::self()->start(); - connect(Plasma::StorageThread::self(), SIGNAL(newResult(StorageJob *, const QVariant &)), this, SLOT(resultSlot(StorageJob *, const QVariant &))); + connect(Plasma::StorageThread::self(), SIGNAL(newResult(StorageJob*,QVariant)), this, SLOT(resultSlot(StorageJob*,QVariant))); qRegisterMetaType(); qRegisterMetaType >(); } diff --git a/scripting/wallpaperscript.cpp b/scripting/wallpaperscript.cpp index edca37dcc..a983baf0b 100644 --- a/scripting/wallpaperscript.cpp +++ b/scripting/wallpaperscript.cpp @@ -45,10 +45,10 @@ WallpaperScript::~WallpaperScript() void WallpaperScript::setWallpaper(Wallpaper *wallpaper) { d->wallpaper = wallpaper; - connect(wallpaper, SIGNAL(renderCompleted(const QImage&)), - this, SLOT(renderCompleted(const QImage&))); - connect(wallpaper, SIGNAL(urlDropped(const KUrl&)), - this, SLOT(urlDropped(const KUrl&))); + connect(wallpaper, SIGNAL(renderCompleted(QImage)), + this, SLOT(renderCompleted(QImage))); + connect(wallpaper, SIGNAL(urlDropped(KUrl)), + this, SLOT(urlDropped(KUrl))); } Wallpaper *WallpaperScript::wallpaper() const diff --git a/tests/testcontainmentactionsplugin/test.cpp b/tests/testcontainmentactionsplugin/test.cpp index 05066b6c9..b058ed733 100644 --- a/tests/testcontainmentactionsplugin/test.cpp +++ b/tests/testcontainmentactionsplugin/test.cpp @@ -88,7 +88,7 @@ QWidget* ContextTest::createConfigurationInterface(QWidget* parent) m_ui.text->setText(m_text); //FIXME this way or just get it on close? - //connect(m_ui.text, SIGNAL(changed(const QColor&)), this, SLOT(setColor(const QColor&))); + //connect(m_ui.text, SIGNAL(changed(QColor)), this, SLOT(setColor(QColor))); //connect(this, SIGNAL(settingsChanged(bool)), parent, SLOT(settingsChanged(bool))); return widget; } diff --git a/view.cpp b/view.cpp index c4aa83560..7ea18d861 100644 --- a/view.cpp +++ b/view.cpp @@ -232,7 +232,7 @@ void View::setContainment(Plasma::Containment *containment) if (d->containment) { disconnect(d->containment, SIGNAL(destroyed(QObject*)), this, SLOT(containmentDestroyed())); disconnect(d->containment, SIGNAL(geometryChanged()), this, SLOT(updateSceneRect())); - disconnect(d->containment, SIGNAL(screenChanged(int, int, Plasma::Containment *)), this, SLOT(containmentScreenChanged(int, int, Plasma::Containment *))); + disconnect(d->containment, SIGNAL(screenChanged(int,int,Plasma::Containment*)), this, SLOT(containmentScreenChanged(int,int,Plasma::Containment*))); d->containment->removeAssociatedWidget(this); } @@ -296,7 +296,7 @@ void View::setContainment(Plasma::Containment *containment) d->updateSceneRect(); connect(containment, SIGNAL(destroyed(QObject*)), this, SLOT(containmentDestroyed())); connect(containment, SIGNAL(geometryChanged()), this, SLOT(updateSceneRect())); - connect(containment, SIGNAL(screenChanged(int, int, Plasma::Containment *)), this, SLOT(containmentScreenChanged(int, int, Plasma::Containment *))); + connect(containment, SIGNAL(screenChanged(int,int,Plasma::Containment*)), this, SLOT(containmentScreenChanged(int,int,Plasma::Containment*))); } Containment *View::containment() const diff --git a/wallpaper.cpp b/wallpaper.cpp index 35d744f7d..c8461313d 100644 --- a/wallpaper.cpp +++ b/wallpaper.cpp @@ -598,7 +598,7 @@ bool WallpaperPrivate::findInCache(const QString &key, unsigned int lastModified } LoadImageThread *loadImageT = new LoadImageThread(cache); - q->connect(loadImageT, SIGNAL(done(const QImage&)), q, SIGNAL(renderCompleted(const QImage&))); + q->connect(loadImageT, SIGNAL(done(QImage)), q, SIGNAL(renderCompleted(QImage))); QThreadPool::globalInstance()->start(loadImageT); return true; diff --git a/widgets/combobox.cpp b/widgets/combobox.cpp index d52eb0ab7..514edf044 100644 --- a/widgets/combobox.cpp +++ b/widgets/combobox.cpp @@ -160,11 +160,11 @@ void ComboBox::setNativeWidget(KComboBox *nativeWidget) widget()->deleteLater(); } - connect(nativeWidget, SIGNAL(activated(const QString &)), this, SIGNAL(activated(const QString &))); + connect(nativeWidget, SIGNAL(activated(QString)), this, SIGNAL(activated(QString))); connect(nativeWidget, SIGNAL(currentIndexChanged(int)), this, SIGNAL(currentIndexChanged(int))); - connect(nativeWidget, SIGNAL(currentIndexChanged(const QString &)), - this, SIGNAL(textChanged(const QString &))); + connect(nativeWidget, SIGNAL(currentIndexChanged(QString)), + this, SIGNAL(textChanged(QString))); d->setWidget(nativeWidget); nativeWidget->setWindowIcon(QIcon()); diff --git a/widgets/lineedit.cpp b/widgets/lineedit.cpp index d000439bf..9e7ff91fe 100644 --- a/widgets/lineedit.cpp +++ b/widgets/lineedit.cpp @@ -125,8 +125,8 @@ void LineEdit::setNativeWidget(KLineEdit *nativeWidget) connect(nativeWidget, SIGNAL(editingFinished()), this, SIGNAL(editingFinished())); connect(nativeWidget, SIGNAL(returnPressed()), this, SIGNAL(returnPressed())); - connect(nativeWidget, SIGNAL(textEdited(const QString&)), this, SIGNAL(textEdited(const QString&))); - connect(nativeWidget, SIGNAL(textChanged(const QString&)), this, SIGNAL(textChanged(const QString&))); + connect(nativeWidget, SIGNAL(textEdited(QString)), this, SIGNAL(textEdited(QString))); + connect(nativeWidget, SIGNAL(textChanged(QString)), this, SIGNAL(textChanged(QString))); nativeWidget->setWindowFlags(nativeWidget->windowFlags()|Qt::BypassGraphicsProxyWidget); diff --git a/widgets/videowidget.cpp b/widgets/videowidget.cpp index d79a9fd95..034131949 100644 --- a/widgets/videowidget.cpp +++ b/widgets/videowidget.cpp @@ -325,7 +325,7 @@ void VideoWidget::setUsedControls(const Controls controls) d->controlsWidget = 0; //disconnect all the stuff that wasn't automatically disconnected 'cause widget deaths - disconnect(d->media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), this, SLOT(stateChanged(Phonon::State, Phonon::State))); + disconnect(d->media, SIGNAL(stateChanged(Phonon::State,Phonon::State)), this, SLOT(stateChanged(Phonon::State,Phonon::State))); disconnect(d->media, SIGNAL(tick(qint64)), this, SLOT(ticked(qint64))); disconnect(d->media, SIGNAL(totalTimeChanged(qint64)), this, SLOT(totalTimeChanged(qint64))); disconnect(d->audioOutput, SIGNAL(volumeChanged(qreal)), this, SLOT(volumeChanged(qreal))); @@ -411,7 +411,7 @@ void VideoWidget::setUsedControls(const Controls controls) d->nextButton = 0; } - connect(d->media, SIGNAL(stateChanged(Phonon::State, Phonon::State)), this, SLOT(stateChanged(Phonon::State, Phonon::State))); + connect(d->media, SIGNAL(stateChanged(Phonon::State,Phonon::State)), this, SLOT(stateChanged(Phonon::State,Phonon::State))); diff --git a/widgets/webview.cpp b/widgets/webview.cpp index f85881c24..11ebc8f9e 100644 --- a/widgets/webview.cpp +++ b/widgets/webview.cpp @@ -86,8 +86,8 @@ WebView::WebView(QGraphicsItem *parent) this, SIGNAL(loadProgress(int))); connect(d->webView, SIGNAL(loadFinished(bool)), this, SLOT(loadingFinished(bool))); - connect(d->webView, SIGNAL(urlChanged(const QUrl &)), - this, SIGNAL(urlChanged(const QUrl &))); + connect(d->webView, SIGNAL(urlChanged(QUrl)), + this, SIGNAL(urlChanged(QUrl))); } WebView::~WebView() From 454cbaa7cb05a06d355487c4b0cce0881c566618 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Mon, 13 Feb 2012 22:30:09 +0100 Subject: [PATCH 3/3] fix up constraintsEvent documentation --- applet.h | 10 ++++++++-- plasma.h | 26 +++++++++----------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/applet.h b/applet.h index 54e2b2202..803fd0a98 100644 --- a/applet.h +++ b/applet.h @@ -1003,9 +1003,15 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget void showMessage(const QIcon &icon, const QString &message, const Plasma::MessageButtons buttons); /** - * Called when any of the geometry constraints have been updated. + * Called when any of the constraints for the applet have been updated. These constraints + * range from notifying when the applet has officially "started up" to when geometry changes + * to when the form factor changes. * - * This is always called prior to painting and should be used as an + * Each constraint that has been changed is passed in the constraints flag. + * All of the constraints and how they work is documented in the @see Plasma::Constraints + * enumeration. + * + * On applet creation, this is always called prior to painting and can be used as an * opportunity to layout the widget, calculate sizings, etc. * * Do not call update() from this method; an update() will be triggered diff --git a/plasma.h b/plasma.h index e4a1c7b1f..9d4a26526 100644 --- a/plasma.h +++ b/plasma.h @@ -42,23 +42,15 @@ namespace Plasma * for instance in Applet::constraintsUpdated */ enum Constraint { - NoConstraint = 0, - /** The FormFactor for an object */ - FormFactorConstraint = 1, - /** The Location of an object */ - LocationConstraint = 2, - /** Which screen an object is on */ - ScreenConstraint = 4, - /** the size of the applet was changed */ - SizeConstraint = 8, - /** the immutability (locked) nature of the applet changed */ - ImmutableConstraint = 16, - /** application startup has completed */ - StartupCompletedConstraint = 32, - /** the desktop context has changed */ - ContextConstraint = 64, - /** the position of the popup needs to be recalculated*/ - PopupConstraint = 128, + NoConstraint = 0, /**< No constraint; never passed in to Applet::constraintsEvent on its own */ + FormFactorConstraint = 1, /**< The FormFactor for an object */ + LocationConstraint = 2, /**< The Location of an object */ + ScreenConstraint = 4, /**< Which screen an object is on */ + SizeConstraint = 8, /**< the size of the applet was changed */ + ImmutableConstraint = 16, /**< the immutability (locked) nature of the applet changed */ + StartupCompletedConstraint = 32, /**< application startup has completed */ + ContextConstraint = 64, /**< the context (e.g. activity) has changed */ + PopupConstraint = 128, /**< the position of the popup needs to be recalculated*/ AllConstraints = FormFactorConstraint | LocationConstraint | ScreenConstraint | SizeConstraint | ImmutableConstraint | ContextConstraint | PopupConstraint };