瀏覽代碼

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.
Andreas Kling 4 年之前
父節點
當前提交
0bfbee4596
共有 1 個文件被更改,包括 1 次插入6 次删除
  1. 1 6
      Userland/Libraries/LibGUI/Command.h

+ 1 - 6
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;
 };
 
 }