From 08a09d27f8614d0259793ceb59a09c6f076a5d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 10 Dec 2013 10:15:23 +0100 Subject: [PATCH] [kwin] Remove the KActionCollection for the client keys Not needed as we can also find the action as a child of Workspace. --- composite.cpp | 1 - useractions.cpp | 6 +++--- workspace.cpp | 4 ---- workspace.h | 6 ------ 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/composite.cpp b/composite.cpp index 16a0c91fe8..717c34b699 100644 --- a/composite.cpp +++ b/composite.cpp @@ -46,7 +46,6 @@ along with this program. If not, see . #include #include #include -#include #include #include #include diff --git a/useractions.cpp b/useractions.cpp index a2cd020e0d..3beff723f0 100755 --- a/useractions.cpp +++ b/useractions.cpp @@ -72,7 +72,6 @@ along with this program. If not, see . #include #include #include -#include #include "killwindow.h" #ifdef KWIN_BUILD_TABBOX @@ -1005,10 +1004,11 @@ void Workspace::setupWindowShortcutDone(bool ok) void Workspace::clientShortcutUpdated(Client* c) { QString key = QStringLiteral("_k_session:%1").arg(c->window()); - QAction* action = client_keys->action(key); + QAction* action = findChild(key); if (!c->shortcut().isEmpty()) { if (action == NULL) { // new shortcut - action = client_keys->addAction(QString(key)); + action = new QAction(this); + action->setObjectName(key); action->setText(i18n("Activate Window (%1)", c->caption())); connect(action, SIGNAL(triggered(bool)), c, SLOT(shortcutActivated())); } diff --git a/workspace.cpp b/workspace.cpp index 3975b63b9d..0b3c0b5bb0 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -61,7 +61,6 @@ along with this program. If not, see . #include "xcbutils.h" #include "main.h" // KDE -#include #include #include #include @@ -147,7 +146,6 @@ Workspace::Workspace(bool restore) , session_saving(false) , block_focus(0) , m_userActionsMenu(new UserActionsMenu(this)) - , client_keys(NULL) , client_keys_dialog(NULL) , client_keys_client(NULL) , global_shortcuts_disabled_for_client(false) @@ -239,8 +237,6 @@ Workspace::Workspace(bool restore) xcb_change_property(connection(), XCB_PROP_MODE_APPEND, rootWindow(), atoms->kwin_running, atoms->kwin_running, 32, 1, &data); - client_keys = new KActionCollection(this); - Outline::create(this); initShortcuts(); diff --git a/workspace.h b/workspace.h index 3ac8279034..81e0a83210 100644 --- a/workspace.h +++ b/workspace.h @@ -38,7 +38,6 @@ along with this program. If not, see . class QStringList; class KConfig; class KConfigGroup; -class KActionCollection; class KStartupInfo; class KStartupInfoId; class KStartupInfoData; @@ -191,10 +190,6 @@ public: int oldDisplayWidth() const; int oldDisplayHeight() const; - KActionCollection* clientKeys() const { - return client_keys; - } - /** * Returns the list of clients sorted in stacking order, with topmost client * at the last position @@ -504,7 +499,6 @@ private: void modalActionsSwitch(bool enabled); - KActionCollection* client_keys; ShortcutDialog* client_keys_dialog; Client* client_keys_client; bool global_shortcuts_disabled_for_client;