diff options
author | Andreas Kling <kling@serenityos.org> | 2021-05-08 21:16:47 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-08 22:17:51 +0200 |
commit | 0bfbee4596b953efcac218a57c16cd63b2ab8f18 (patch) | |
tree | 6231412bd11047e46806cd7ff9b8f253f3a73bf4 /Userland/Libraries/LibGUI/Command.h | |
parent | bfd2ec88f44e887e9d5049deb8e5e0838dc4f926 (diff) | |
download | serenity-0bfbee4596b953efcac218a57c16cd63b2ab8f18.zip |
LibGUI: Make Command::action_text() virtual
It will be easier for some commands to generate an action text on the
fly instead of having to think of it up front, so a virtual that you
can override seems more convenient here.
Diffstat (limited to 'Userland/Libraries/LibGUI/Command.h')
-rw-r--r-- | Userland/Libraries/LibGUI/Command.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/Userland/Libraries/LibGUI/Command.h b/Userland/Libraries/LibGUI/Command.h index 82626fd7cb..e7db7d7678 100644 --- a/Userland/Libraries/LibGUI/Command.h +++ b/Userland/Libraries/LibGUI/Command.h @@ -17,16 +17,11 @@ public: virtual void undo() { } virtual void redo() { } - String action_text() const { return m_action_text; } - + virtual String action_text() const { return {}; } virtual bool merge_with(Command const&) { return false; } protected: Command() { } - void set_action_text(const String& text) { m_action_text = text; } - -private: - String m_action_text; }; } |