diff options
-rw-r--r-- | Userland/Libraries/LibGUI/TabWidget.cpp | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/TabWidget.h | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/Userland/Libraries/LibGUI/TabWidget.cpp b/Userland/Libraries/LibGUI/TabWidget.cpp index d2c4136183..e9499542ad 100644 --- a/Userland/Libraries/LibGUI/TabWidget.cpp +++ b/Userland/Libraries/LibGUI/TabWidget.cpp @@ -44,9 +44,9 @@ TabWidget::~TabWidget() { } -ErrorOr<void> TabWidget::try_add_widget(StringView title, Widget& widget) +ErrorOr<void> TabWidget::try_add_widget(String title, Widget& widget) { - m_tabs.append({ title, nullptr, &widget }); + m_tabs.append({ move(title), nullptr, &widget }); add_child(widget); update_focus_policy(); if (on_tab_count_change) @@ -54,9 +54,9 @@ ErrorOr<void> TabWidget::try_add_widget(StringView title, Widget& widget) return {}; } -void TabWidget::add_widget(StringView title, Widget& widget) +void TabWidget::add_widget(String title, Widget& widget) { - MUST(try_add_widget(title, widget)); + MUST(try_add_widget(move(title), widget)); } void TabWidget::remove_widget(Widget& widget) diff --git a/Userland/Libraries/LibGUI/TabWidget.h b/Userland/Libraries/LibGUI/TabWidget.h index ac0d5402d0..2addcc729b 100644 --- a/Userland/Libraries/LibGUI/TabWidget.h +++ b/Userland/Libraries/LibGUI/TabWidget.h @@ -36,24 +36,24 @@ public: GUI::Margins const& container_margins() const { return m_container_margins; } void set_container_margins(GUI::Margins const&); - ErrorOr<void> try_add_widget(StringView, Widget&); + ErrorOr<void> try_add_widget(String, Widget&); - void add_widget(StringView, Widget&); + void add_widget(String, Widget&); void remove_widget(Widget&); template<class T, class... Args> - ErrorOr<NonnullRefPtr<T>> try_add_tab(StringView title, Args&&... args) + ErrorOr<NonnullRefPtr<T>> try_add_tab(String title, Args&&... args) { auto t = TRY(T::try_create(forward<Args>(args)...)); - TRY(try_add_widget(title, *t)); + TRY(try_add_widget(move(title), *t)); return *t; } template<class T, class... Args> - T& add_tab(StringView title, Args&&... args) + T& add_tab(String title, Args&&... args) { auto t = T::construct(forward<Args>(args)...); - add_widget(title, *t); + add_widget(move(title), *t); return *t; } |