From a4f5c6f203f00cb0ca3dba8a84568d8adf73ebd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 30 Apr 2012 22:31:04 +0200 Subject: [PATCH] Improved handling of defines in kwinbindings * drop NOSLOTS nowhere else used or set * drop DEF4 as unused * undef DEF3 * drop KWIN_CONNECT (merged into DEF2 and DEF3) REVIEW: 104800 --- kwinbindings.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/kwinbindings.cpp b/kwinbindings.cpp index 1f0d7ceda0..b6fb09b8a0 100644 --- a/kwinbindings.cpp +++ b/kwinbindings.cpp @@ -27,21 +27,11 @@ along with this program. If not, see . // normal human descriptions with DEF2() the others can use DEF() // new DEF3 allows to pass data to the action, replacing the %1 argument in the name -#ifndef NOSLOTS -#define KWIN_CONNECT(_FNSLOT_) connect(a,SIGNAL(triggered(bool)),SLOT(_FNSLOT_)); -#else -#define KWIN_CONNECT(_FNSLOT_) /*noop*/ -#endif - #define DEF2( name, descr, key, fnSlot ) \ a = actionCollection->addAction( name ); \ a->setText( i18n(descr) ); \ qobject_cast( a )->setGlobalShortcut(KShortcut(key)); \ - KWIN_CONNECT(fnSlot) - -#define DEF4( name, descr, key, fnSlot, value ) \ - DEF2(name, descr, key, fnSlot) \ - a->setData(value); + connect(a, SIGNAL(triggered(bool)), SLOT(fnSlot)); #define DEF( name, key, fnSlot ) \ DEF2(name, name, key, fnSlot) @@ -51,7 +41,7 @@ along with this program. If not, see . a->setText( i18n(name, value) ); \ qobject_cast( a )->setGlobalShortcut(KShortcut(key)); \ a->setData(value); \ - KWIN_CONNECT(fnSlot) + connect(a, SIGNAL(triggered(bool)), SLOT(fnSlot)); a = actionCollection->addAction("Program:kwin"); @@ -195,5 +185,6 @@ DEF(I18N_NOOP("Invert Screen Colors"), 0, slotInvertScreen()); #undef DEF #undef DEF2 +#undef DEF3 // }