[kwin] Remove the KActionCollection for the client keys

Not needed as we can also find the action as a child of Workspace.
This commit is contained in:
Martin Gräßlin 2013-12-10 10:15:23 +01:00
parent a6f32bf3e8
commit 08a09d27f8
4 changed files with 3 additions and 14 deletions

View file

@ -46,7 +46,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QTimerEvent> #include <QTimerEvent>
#include <QDateTime> #include <QDateTime>
#include <QDBusConnection> #include <QDBusConnection>
#include <kactioncollection.h>
#include <KDE/KGlobalAccel> #include <KDE/KGlobalAccel>
#include <KDE/KLocalizedString> #include <KDE/KLocalizedString>
#include <KDE/KNotification> #include <KDE/KNotification>

View file

@ -72,7 +72,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QMenu> #include <QMenu>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <kauthorized.h> #include <kauthorized.h>
#include <kactioncollection.h>
#include "killwindow.h" #include "killwindow.h"
#ifdef KWIN_BUILD_TABBOX #ifdef KWIN_BUILD_TABBOX
@ -1005,10 +1004,11 @@ void Workspace::setupWindowShortcutDone(bool ok)
void Workspace::clientShortcutUpdated(Client* c) void Workspace::clientShortcutUpdated(Client* c)
{ {
QString key = QStringLiteral("_k_session:%1").arg(c->window()); QString key = QStringLiteral("_k_session:%1").arg(c->window());
QAction* action = client_keys->action(key); QAction* action = findChild<QAction*>(key);
if (!c->shortcut().isEmpty()) { if (!c->shortcut().isEmpty()) {
if (action == NULL) { // new shortcut 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())); action->setText(i18n("Activate Window (%1)", c->caption()));
connect(action, SIGNAL(triggered(bool)), c, SLOT(shortcutActivated())); connect(action, SIGNAL(triggered(bool)), c, SLOT(shortcutActivated()));
} }

View file

@ -61,7 +61,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "xcbutils.h" #include "xcbutils.h"
#include "main.h" #include "main.h"
// KDE // KDE
#include <KDE/KActionCollection>
#include <KDE/KConfig> #include <KDE/KConfig>
#include <KDE/KConfigGroup> #include <KDE/KConfigGroup>
#include <KDE/KLocalizedString> #include <KDE/KLocalizedString>
@ -147,7 +146,6 @@ Workspace::Workspace(bool restore)
, session_saving(false) , session_saving(false)
, block_focus(0) , block_focus(0)
, m_userActionsMenu(new UserActionsMenu(this)) , m_userActionsMenu(new UserActionsMenu(this))
, client_keys(NULL)
, client_keys_dialog(NULL) , client_keys_dialog(NULL)
, client_keys_client(NULL) , client_keys_client(NULL)
, global_shortcuts_disabled_for_client(false) , 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, xcb_change_property(connection(), XCB_PROP_MODE_APPEND, rootWindow(), atoms->kwin_running,
atoms->kwin_running, 32, 1, &data); atoms->kwin_running, 32, 1, &data);
client_keys = new KActionCollection(this);
Outline::create(this); Outline::create(this);
initShortcuts(); initShortcuts();

View file

@ -38,7 +38,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
class QStringList; class QStringList;
class KConfig; class KConfig;
class KConfigGroup; class KConfigGroup;
class KActionCollection;
class KStartupInfo; class KStartupInfo;
class KStartupInfoId; class KStartupInfoId;
class KStartupInfoData; class KStartupInfoData;
@ -191,10 +190,6 @@ public:
int oldDisplayWidth() const; int oldDisplayWidth() const;
int oldDisplayHeight() const; int oldDisplayHeight() const;
KActionCollection* clientKeys() const {
return client_keys;
}
/** /**
* Returns the list of clients sorted in stacking order, with topmost client * Returns the list of clients sorted in stacking order, with topmost client
* at the last position * at the last position
@ -504,7 +499,6 @@ private:
void modalActionsSwitch(bool enabled); void modalActionsSwitch(bool enabled);
KActionCollection* client_keys;
ShortcutDialog* client_keys_dialog; ShortcutDialog* client_keys_dialog;
Client* client_keys_client; Client* client_keys_client;
bool global_shortcuts_disabled_for_client; bool global_shortcuts_disabled_for_client;