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
icc-effect-5.14.5
Martin Gräßlin 2012-04-30 22:31:04 +02:00
parent c8320b0db7
commit a4f5c6f203
1 changed files with 3 additions and 12 deletions

View File

@ -27,21 +27,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// 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<KAction*>( 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 <http://www.gnu.org/licenses/>.
a->setText( i18n(name, value) ); \
qobject_cast<KAction*>( 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
// }