From 0bfbee4596b953efcac218a57c16cd63b2ab8f18 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 8 May 2021 21:16:47 +0200 Subject: [PATCH] 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. --- Userland/Libraries/LibGUI/Command.h | 7 +------ 1 file changed, 1 insertion(+), 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; }; }