From 942b49e2c4cff97085b7cd3cc2697d69deadbb7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 6 Mar 2015 09:03:08 +0100 Subject: [PATCH] Workspace::setupWindowShortcut operates on AbstractClient --- abstract_client.h | 2 ++ client.h | 4 ++-- useractions.cpp | 2 +- workspace.h | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/abstract_client.h b/abstract_client.h index 5c97cfbd5a..9a1befe32c 100644 --- a/abstract_client.h +++ b/abstract_client.h @@ -61,6 +61,8 @@ public: virtual bool isSpecialWindow() const = 0; virtual bool isActive() const = 0; virtual void sendToScreen(int screen) = 0; + virtual const QKeySequence &shortcut() const = 0; + virtual void setShortcut(const QString &cut) = 0; // TODO: remove boolean trap static bool belongToSameApplication(const AbstractClient* c1, const AbstractClient* c2, bool active_hack = false); diff --git a/client.h b/client.h index 63466551ce..50553c68e9 100644 --- a/client.h +++ b/client.h @@ -489,8 +489,8 @@ public: void shrinkVertical(); bool providesContextHelp() const; - const QKeySequence &shortcut() const; - void setShortcut(const QString& cut); + const QKeySequence &shortcut() const override; + void setShortcut(const QString& cut) override; Options::WindowOperation mouseButtonToWindowOperation(Qt::MouseButtons button); bool performMouseCommand(Options::MouseCommand, const QPoint& globalPos); diff --git a/useractions.cpp b/useractions.cpp index ce1c28e13a..9eee210eac 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -954,7 +954,7 @@ void Workspace::initShortcuts() m_userActionsMenu->discard(); // so that it's recreated next time } -void Workspace::setupWindowShortcut(Client* c) +void Workspace::setupWindowShortcut(AbstractClient* c) { assert(client_keys_dialog == NULL); // TODO: PORT ME (KGlobalAccel related) diff --git a/workspace.h b/workspace.h index da8a779a18..900e06a722 100644 --- a/workspace.h +++ b/workspace.h @@ -467,7 +467,7 @@ private: template void initShortcut(const QString &actionName, const QString &description, const QKeySequence &shortcut, Slot slot, const QVariant &data = QVariant()); - void setupWindowShortcut(Client* c); + void setupWindowShortcut(AbstractClient* c); enum Direction { DirectionNorth, DirectionEast, @@ -503,7 +503,7 @@ private: Client *findClientToActivateOnDesktop(uint desktop); QWidget* active_popup; - Client* active_popup_client; + AbstractClient* active_popup_client; void loadSessionInfo(); void addSessionInfo(KConfigGroup &cg); @@ -556,7 +556,7 @@ private: void modalActionsSwitch(bool enabled); ShortcutDialog* client_keys_dialog; - Client* client_keys_client; + AbstractClient* client_keys_client; bool global_shortcuts_disabled_for_client; // Timer to collect requests for 'reconfigure'