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