diff --git a/tabbox/tabbox.cpp b/tabbox/tabbox.cpp index 869bd779a9..9969d37818 100644 --- a/tabbox/tabbox.cpp +++ b/tabbox/tabbox.cpp @@ -48,7 +48,6 @@ along with this program. If not, see . #include #include // KDE -#include #include #include #include @@ -486,9 +485,10 @@ void TabBox::handlerReady() } template -void TabBox::key(KActionCollection *keys, const char *actionName, Slot slot, const QKeySequence &shortcut) +void TabBox::key(const char *actionName, Slot slot, const QKeySequence &shortcut) { - QAction *a = keys->addAction(QString::fromUtf8(actionName)); + QAction *a = new QAction(this); + a->setObjectName(QString::fromUtf8(actionName)); a->setText(i18n(actionName)); KGlobalAccel::self()->setShortcut(a, QList() << shortcut); connect(a, &QAction::triggered, TabBox::self(), slot); @@ -509,20 +509,20 @@ static const char *s_desktopsRev = I18N_NOOP("Walk Through Desktops (Reverse) static const char *s_desktopList = I18N_NOOP("Walk Through Desktop List"); static const char *s_desktopListRev = I18N_NOOP("Walk Through Desktop List (Reverse)"); -void TabBox::initShortcuts(KActionCollection* keys) +void TabBox::initShortcuts() { - key(keys, s_windows, &TabBox::slotWalkThroughWindows, Qt::ALT + Qt::Key_Tab); - key(keys, s_windowsRev, &TabBox::slotWalkBackThroughWindows, Qt::ALT + Qt::SHIFT + Qt::Key_Backtab); - key(keys, s_app, &TabBox::slotWalkThroughCurrentAppWindows, Qt::ALT + Qt::Key_QuoteLeft); - key(keys, s_appRev, &TabBox::slotWalkBackThroughCurrentAppWindows, Qt::ALT + Qt::Key_AsciiTilde); - key(keys, s_windowsAlt, &TabBox::slotWalkThroughWindowsAlternative); - key(keys, s_windowsAltRev, &TabBox::slotWalkBackThroughWindowsAlternative); - key(keys, s_appAlt, &TabBox::slotWalkThroughCurrentAppWindowsAlternative); - key(keys, s_appAltRev, &TabBox::slotWalkBackThroughCurrentAppWindowsAlternative); - key(keys, s_desktops, &TabBox::slotWalkThroughDesktops); - key(keys, s_desktopsRev, &TabBox::slotWalkBackThroughDesktops); - key(keys, s_desktopList, &TabBox::slotWalkThroughDesktopList); - key(keys, s_desktopListRev, &TabBox::slotWalkBackThroughDesktopList); + key(s_windows, &TabBox::slotWalkThroughWindows, Qt::ALT + Qt::Key_Tab); + key(s_windowsRev, &TabBox::slotWalkBackThroughWindows, Qt::ALT + Qt::SHIFT + Qt::Key_Backtab); + key(s_app, &TabBox::slotWalkThroughCurrentAppWindows, Qt::ALT + Qt::Key_QuoteLeft); + key(s_appRev, &TabBox::slotWalkBackThroughCurrentAppWindows, Qt::ALT + Qt::Key_AsciiTilde); + key(s_windowsAlt, &TabBox::slotWalkThroughWindowsAlternative); + key(s_windowsAltRev, &TabBox::slotWalkBackThroughWindowsAlternative); + key(s_appAlt, &TabBox::slotWalkThroughCurrentAppWindowsAlternative); + key(s_appAltRev, &TabBox::slotWalkBackThroughCurrentAppWindowsAlternative); + key(s_desktops, &TabBox::slotWalkThroughDesktops); + key(s_desktopsRev, &TabBox::slotWalkBackThroughDesktops); + key(s_desktopList, &TabBox::slotWalkThroughDesktopList); + key(s_desktopListRev, &TabBox::slotWalkBackThroughDesktopList); connect(KGlobalAccel::self(), &KGlobalAccel::globalShortcutChanged, this, &TabBox::globalShortcutChanged); } diff --git a/tabbox/tabbox.h b/tabbox/tabbox.h index 7ffb201967..30575e278e 100644 --- a/tabbox/tabbox.h +++ b/tabbox/tabbox.h @@ -29,7 +29,6 @@ along with this program. If not, see . #include "utils.h" #include "tabbox/tabboxhandler.h" -class KActionCollection; class KConfigGroup; class QAction; class QKeyEvent; @@ -168,7 +167,7 @@ public: return m_tabGrab || m_desktopGrab; }; - void initShortcuts(KActionCollection* keys); + void initShortcuts(); Client* nextClientStatic(Client*) const; Client* previousClientStatic(Client*) const; @@ -253,7 +252,7 @@ private: bool establishTabBoxGrab(); void removeTabBoxGrab(); template - void key(KActionCollection *keys, const char *actionName, Slot slot, const QKeySequence &shortcut = QKeySequence()); + void key(const char *actionName, Slot slot, const QKeySequence &shortcut = QKeySequence()); private Q_SLOTS: void reconfigure(); diff --git a/useractions.cpp b/useractions.cpp index 9123886a5c..90aad330a2 100755 --- a/useractions.cpp +++ b/useractions.cpp @@ -962,7 +962,7 @@ void Workspace::initShortcuts() #define IN_KWIN #include "kwinbindings.cpp" #ifdef KWIN_BUILD_TABBOX - TabBox::TabBox::self()->initShortcuts(actionCollection); + TabBox::TabBox::self()->initShortcuts(); #endif VirtualDesktopManager::self()->initShortcuts(); m_userActionsMenu->discard(); // so that it's recreated next time