From 4f08a05a3b55ab47eb550d562b834ce124fbb26b Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Fri, 10 Mar 2023 20:34:00 +0100 Subject: [PATCH] LibGUI: Store Tab titles using the new string class --- Userland/Libraries/LibGUI/TabWidget.cpp | 4 ++-- Userland/Libraries/LibGUI/TabWidget.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibGUI/TabWidget.cpp b/Userland/Libraries/LibGUI/TabWidget.cpp index d01f9abac9..dce58a0093 100644 --- a/Userland/Libraries/LibGUI/TabWidget.cpp +++ b/Userland/Libraries/LibGUI/TabWidget.cpp @@ -53,7 +53,7 @@ TabWidget::TabWidget() ErrorOr TabWidget::try_add_widget(Widget& widget) { - TRY(m_tabs.try_append({ widget.title().to_deprecated_string(), nullptr, &widget, false })); + TRY(m_tabs.try_append({ widget.title(), nullptr, &widget, false })); TRY(try_add_child(widget)); update_focus_policy(); if (on_tab_count_change) @@ -596,7 +596,7 @@ void TabWidget::set_tab_title(Widget& tab, StringView title) for (auto& t : m_tabs) { if (t.widget == &tab) { if (t.title != title) { - t.title = title; + t.title = String::from_utf8(title).release_value_but_fixme_should_propagate_errors(); update(); } return; diff --git a/Userland/Libraries/LibGUI/TabWidget.h b/Userland/Libraries/LibGUI/TabWidget.h index d2432e4d64..ce3aa75a9a 100644 --- a/Userland/Libraries/LibGUI/TabWidget.h +++ b/Userland/Libraries/LibGUI/TabWidget.h @@ -147,7 +147,7 @@ private: struct TabData { int width(Gfx::Font const&) const; - DeprecatedString title; + String title; RefPtr icon; Widget* widget { nullptr }; bool modified { false };