Port kwinbindings.cpp away from KAction/KShortcut

REVIEW: 112119
This commit is contained in:
Reza Shah 2013-08-28 19:27:09 +09:00
parent c5c5fffbdf
commit 9c2e4991cf
2 changed files with 6 additions and 2 deletions

View file

@ -30,7 +30,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DEF2( name, descr, key, fnSlot ) \
a = actionCollection->addAction( QStringLiteral(name) ); \
a->setText( i18n(descr) ); \
qobject_cast<KAction*>( a )->setGlobalShortcut(KShortcut(key)); \
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << key); \
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << key); \
connect(a, SIGNAL(triggered(bool)), SLOT(fnSlot));
#define DEF( name, key, fnSlot ) \
@ -39,7 +40,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DEF3( name, key, fnSlot, value ) \
a = actionCollection->addAction( QStringLiteral(name).arg(value) ); \
a->setText( i18n(name, value) ); \
qobject_cast<KAction*>( a )->setGlobalShortcut(KShortcut(key)); \
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << key); \
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << key); \
a->setData(value); \
connect(a, SIGNAL(triggered(bool)), SLOT(fnSlot));

View file

@ -57,10 +57,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <X11/extensions/xf86vmode.h>
#endif
#include <fixx11h.h>
#include <QAction>
#include <QCheckBox>
#include <QtConcurrentRun>
#include <QPushButton>
#include <KDE/KGlobalAccel>
#include <kglobalsettings.h>
#include <KDE/KIcon>
#include <kiconloader.h>