port more to new connect syntax to catch more errors

This commit is contained in:
Marco Martin 2013-02-18 18:54:44 +01:00
parent 57add3903f
commit 86d89bf634
4 changed files with 19 additions and 13 deletions

View File

@ -699,7 +699,7 @@ QString Containment::containmentActions(const QString &trigger)
void Containment::setActivity(const QString &activityId) void Containment::setActivity(const QString &activityId)
{ {
if (activityId.isEmpty()) { if (activityId.isEmpty() || d->activityId == activityId) {
return; return;
} }
@ -708,6 +708,7 @@ void Containment::setActivity(const QString &activityId)
c.writeEntry("activityId", activityId); c.writeEntry("activityId", activityId);
emit configNeedsSaving(); emit configNeedsSaving();
emit activityChanged(activityId);
} }
QString Containment::activity() const QString Containment::activity() const

View File

@ -337,6 +337,11 @@ Q_SIGNALS:
*/ */
void appletRemoved(Plasma::Applet *applet); void appletRemoved(Plasma::Applet *applet);
/**
* Emitted when the activity id has changed
*/
void activityChanged(const QString &activity);
/** /**
* Emitted when the user clicks on the toolbox * Emitted when the user clicks on the toolbox
*/ */

View File

@ -47,16 +47,16 @@ ContainmentInterface::ContainmentInterface(DeclarativeAppletScript *parent)
this, &ContainmentInterface::appletRemovedForward); this, &ContainmentInterface::appletRemovedForward);
connect(containment(), &Plasma::Containment::appletAdded, connect(containment(), &Plasma::Containment::appletAdded,
this, &ContainmentInterface::appletAddedForward); this, &ContainmentInterface::appletAddedForward);
connect(containment(), SIGNAL(screenChanged(int, int, Plasma::Containment*)), connect(containment(), &Plasma::Containment::screenChanged,
this, SIGNAL(screenChanged())); this, &ContainmentInterface::screenChanged);
connect(containment(), SIGNAL(activityChanged()), connect(containment(), &Plasma::Containment::activityChanged,
this, SIGNAL(activityChanged())); this, &ContainmentInterface::activityChanged);
connect(containment(), SIGNAL(wallpaperChanged()), connect(containment(), &Plasma::Containment::wallpaperChanged,
this, SLOT(loadWallpaper())); this, &ContainmentInterface::loadWallpaper);
if (containment()->corona()) { if (containment()->corona()) {
connect(containment()->corona(), SIGNAL(availableScreenRegionChanged()), connect(containment()->corona(), &Plasma::Corona::availableScreenRegionChanged,
this, SIGNAL(availableScreenRegionChanged())); this, &ContainmentInterface::availableScreenRegionChanged);
} }
loadWallpaper(); loadWallpaper();
} }
@ -200,7 +200,7 @@ void ContainmentInterface::loadWallpaper()
} }
} }
QString ContainmentInterface::activityId() const QString ContainmentInterface::activity() const
{ {
return containment()->activity(); return containment()->activity();
} }

View File

@ -36,7 +36,7 @@ class ContainmentInterface : public AppletInterface
Q_PROPERTY(bool drawWallpaper READ drawWallpaper WRITE setDrawWallpaper) Q_PROPERTY(bool drawWallpaper READ drawWallpaper WRITE setDrawWallpaper)
Q_PROPERTY(Type containmentType READ containmentType WRITE setContainmentType) Q_PROPERTY(Type containmentType READ containmentType WRITE setContainmentType)
Q_PROPERTY(int screen READ screen NOTIFY screenChanged) Q_PROPERTY(int screen READ screen NOTIFY screenChanged)
Q_PROPERTY(QString activityId READ activityId NOTIFY activityIdChanged) Q_PROPERTY(QString activity READ activity NOTIFY activityChanged)
Q_ENUMS(Type) Q_ENUMS(Type)
public: public:
@ -60,7 +60,7 @@ public:
void setContainmentType(Type type); void setContainmentType(Type type);
int screen() const; int screen() const;
QString activityId() const; QString activity() const;
Q_INVOKABLE QRectF screenGeometry(int id) const; Q_INVOKABLE QRectF screenGeometry(int id) const;
Q_INVOKABLE QVariantList availableScreenRegion(int id) const; Q_INVOKABLE QVariantList availableScreenRegion(int id) const;
@ -76,7 +76,7 @@ Q_SIGNALS:
void appletAdded(QObject *applet); void appletAdded(QObject *applet);
void appletRemoved(QObject *applet); void appletRemoved(QObject *applet);
void screenChanged(); void screenChanged();
void activityIdChanged(); void activityChanged();
void availableScreenRegionChanged(); void availableScreenRegionChanged();
void appletsChanged(); void appletsChanged();