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.
This commit is contained in:
Andreas Kling 2021-05-08 21:16:47 +02:00
parent bfd2ec88f4
commit 0bfbee4596
Notes: sideshowbarker 2024-07-18 18:28:44 +09:00

View file

@ -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;
};
}