[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 <QDateTime>
#include <QDBusConnection>
#include <kactioncollection.h>
#include <KDE/KGlobalAccel>
#include <KDE/KLocalizedString>
#include <KDE/KNotification>

View file

@ -72,7 +72,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QMenu>
#include <QVBoxLayout>
#include <kauthorized.h>
#include <kactioncollection.h>
#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<QAction*>(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()));
}

View file

@ -61,7 +61,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "xcbutils.h"
#include "main.h"
// KDE
#include <KDE/KActionCollection>
#include <KDE/KConfig>
#include <KDE/KConfigGroup>
#include <KDE/KLocalizedString>
@ -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();

View file

@ -38,7 +38,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
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;