From c5e60a7ce835a40540db61057d23bb7014983632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 23 Aug 2013 19:18:25 +0200 Subject: [PATCH] Add properties for keepAbove/Below to KDecoration For consistency two new changed signals are introduced without any argument and the old signals are marked as deprecated. --- clients/aurorae/src/aurorae.cpp | 2 -- clients/aurorae/src/aurorae.h | 4 ---- libkdecorations/kdecoration.cpp | 4 ++++ libkdecorations/kdecoration.h | 12 ++++++++++++ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/clients/aurorae/src/aurorae.cpp b/clients/aurorae/src/aurorae.cpp index 2767706f1b..d95cdfe43e 100644 --- a/clients/aurorae/src/aurorae.cpp +++ b/clients/aurorae/src/aurorae.cpp @@ -234,8 +234,6 @@ AuroraeClient::AuroraeClient(KDecorationBridge *bridge, KDecorationFactory *fact , m_scene(new QGraphicsScene(this)) , m_item(AuroraeFactory::instance()->createQmlDecoration(this)) { - connect(this, SIGNAL(keepAboveChanged(bool)), SIGNAL(keepAboveChangedWrapper())); - connect(this, SIGNAL(keepBelowChanged(bool)), SIGNAL(keepBelowChangedWrapper())); connect(AuroraeFactory::instance(), SIGNAL(buttonsChanged()), SIGNAL(buttonsChanged())); connect(AuroraeFactory::instance(), SIGNAL(configChanged()), SIGNAL(configChanged())); connect(AuroraeFactory::instance(), SIGNAL(titleFontChanged()), SIGNAL(fontChanged())); diff --git a/clients/aurorae/src/aurorae.h b/clients/aurorae/src/aurorae.h index c4fb03a090..4bbefa313a 100644 --- a/clients/aurorae/src/aurorae.h +++ b/clients/aurorae/src/aurorae.h @@ -97,8 +97,6 @@ class AuroraeClient : public KDecoration Q_PROPERTY(bool preview READ isPreview CONSTANT) Q_PROPERTY(bool resizeable READ isResizable CONSTANT) Q_PROPERTY(bool shadeable READ isShadeable) - Q_PROPERTY(bool keepAbove READ keepAbove WRITE setKeepAbove NOTIFY keepAboveChangedWrapper) - Q_PROPERTY(bool keepBelow READ keepBelow WRITE setKeepBelow NOTIFY keepBelowChangedWrapper) Q_PROPERTY(bool providesContextHelp READ providesContextHelp) Q_PROPERTY(bool appMenu READ menuAvailable NOTIFY appMenuAvailableChanged) Q_PROPERTY(QRect transparentRect READ transparentRect) @@ -125,8 +123,6 @@ public: Q_INVOKABLE QVariant readConfig(const QString &key, const QVariant &defaultValue = QVariant()); Q_SIGNALS: - void keepAboveChangedWrapper(); - void keepBelowChangedWrapper(); void buttonsChanged(); /** * Signal emitted when the decoration's configuration might have changed. diff --git a/libkdecorations/kdecoration.cpp b/libkdecorations/kdecoration.cpp index 4d2eddd75c..4d7a68dce3 100644 --- a/libkdecorations/kdecoration.cpp +++ b/libkdecorations/kdecoration.cpp @@ -70,6 +70,10 @@ KDecoration::KDecoration(KDecorationBridge* bridge, KDecorationFactory* factory) d(new KDecorationPrivate()) { factory->addDecoration(this); + connect(this, static_cast(&KDecoration::keepAboveChanged), + this, static_cast(&KDecoration::keepAboveChanged)); + connect(this, static_cast(&KDecoration::keepBelowChanged), + this, static_cast(&KDecoration::keepBelowChanged)); } KDecoration::~KDecoration() diff --git a/libkdecorations/kdecoration.h b/libkdecorations/kdecoration.h index e265984ef7..7955901c88 100644 --- a/libkdecorations/kdecoration.h +++ b/libkdecorations/kdecoration.h @@ -497,6 +497,8 @@ class KWIN_EXPORT KDecoration Q_PROPERTY(bool setShade READ isSetShade NOTIFY shadeChanged) Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged) Q_PROPERTY(bool maximized READ isMaximized NOTIFY maximizeChanged) + Q_PROPERTY(bool keepAbove READ keepAbove WRITE setKeepAbove NOTIFY keepAboveChanged) + Q_PROPERTY(bool keepBelow READ keepBelow WRITE setKeepBelow NOTIFY keepBelowChanged) public: /** * Constructs a KDecoration object. Both the arguments are passed from @@ -863,9 +865,19 @@ Q_SIGNALS: /** * This signal is emitted whenever the window's keep-above state changes. */ + void keepAboveChanged(); + /** + * This signal is emitted whenever the window's keep-below state changes. + */ + void keepBelowChanged(); + /** + * This signal is emitted whenever the window's keep-above state changes. + * @deprecated connect to signal without argument + */ void keepAboveChanged(bool); /** * This signal is emitted whenever the window's keep-below state changes. + * @deprecated connect to signal without argument */ void keepBelowChanged(bool); /**