diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-07-09 21:28:52 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-09 21:28:52 +0200 |
commit | 2ae0333f5de5f83541869a9a5b45847a923709c3 (patch) | |
tree | 6f4fc63fbb1a562ac9af46a1f31260c5314b73f2 /Libraries | |
parent | fe69b326e91983e2f20e54195c2950398dad587b (diff) | |
download | serenity-2ae0333f5de5f83541869a9a5b45847a923709c3.zip |
GAction: Remove "custom_data" and the related convenience constructors.
This mechanism was never actually used, just something I imagined would be
useful while I was first creating the class.
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibGUI/GAction.cpp | 8 | ||||
-rw-r--r-- | Libraries/LibGUI/GAction.h | 7 |
2 files changed, 1 insertions, 14 deletions
diff --git a/Libraries/LibGUI/GAction.cpp b/Libraries/LibGUI/GAction.cpp index 8d9d023f87..530f553a87 100644 --- a/Libraries/LibGUI/GAction.cpp +++ b/Libraries/LibGUI/GAction.cpp @@ -3,19 +3,13 @@ #include <LibGUI/GButton.h> #include <LibGUI/GMenuItem.h> -GAction::GAction(const StringView& text, const StringView& custom_data, Function<void(GAction&)> on_activation_callback, GWidget* widget) +GAction::GAction(const StringView& text, Function<void(GAction&)> on_activation_callback, GWidget* widget) : on_activation(move(on_activation_callback)) , m_text(text) - , m_custom_data(custom_data) , m_widget(widget ? widget->make_weak_ptr() : nullptr) { } -GAction::GAction(const StringView& text, Function<void(GAction&)> on_activation_callback, GWidget* widget) - : GAction(text, String(), move(on_activation_callback), widget) -{ -} - GAction::GAction(const StringView& text, RefPtr<GraphicsBitmap>&& icon, Function<void(GAction&)> on_activation_callback, GWidget* widget) : on_activation(move(on_activation_callback)) , m_text(text) diff --git a/Libraries/LibGUI/GAction.h b/Libraries/LibGUI/GAction.h index 1a80737721..021f4fa4c9 100644 --- a/Libraries/LibGUI/GAction.h +++ b/Libraries/LibGUI/GAction.h @@ -27,10 +27,6 @@ public: { return adopt(*new GAction(text, move(callback), widget)); } - static NonnullRefPtr<GAction> create(const StringView& text, const StringView& custom_data, Function<void(GAction&)> callback, GWidget* widget = nullptr) - { - return adopt(*new GAction(text, custom_data, move(callback), widget)); - } static NonnullRefPtr<GAction> create(const StringView& text, RefPtr<GraphicsBitmap>&& icon, Function<void(GAction&)> callback, GWidget* widget = nullptr) { return adopt(*new GAction(text, move(icon), move(callback), widget)); @@ -50,7 +46,6 @@ public: String text() const { return m_text; } GShortcut shortcut() const { return m_shortcut; } - String custom_data() const { return m_custom_data; } const GraphicsBitmap* icon() const { return m_icon.ptr(); } Function<void(GAction&)> on_activation; @@ -80,7 +75,6 @@ private: GAction(const StringView& text, const GShortcut&, Function<void(GAction&)> = nullptr, GWidget* = nullptr); GAction(const StringView& text, const GShortcut&, RefPtr<GraphicsBitmap>&& icon, Function<void(GAction&)> = nullptr, GWidget* = nullptr); GAction(const StringView& text, RefPtr<GraphicsBitmap>&& icon, Function<void(GAction&)> = nullptr, GWidget* = nullptr); - GAction(const StringView& text, const StringView& custom_data = StringView(), Function<void(GAction&)> = nullptr, GWidget* = nullptr); template<typename Callback> void for_each_toolbar_button(Callback); @@ -88,7 +82,6 @@ private: void for_each_menu_item(Callback); String m_text; - String m_custom_data; RefPtr<GraphicsBitmap> m_icon; GShortcut m_shortcut; bool m_enabled { true }; |