diff options
author | Linus Groh <mail@linusgroh.de> | 2022-12-04 18:02:33 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-06 08:54:33 +0100 |
commit | 6e19ab2bbce0b113b628e6f8e9b5c0640053933e (patch) | |
tree | 372d21b2f5dcff112f5d0089559c6af5798680d4 /Userland/Applications/ThemeEditor | |
parent | f74251606d74b504a1379ebb893fdb5529054ea5 (diff) | |
download | serenity-6e19ab2bbce0b113b628e6f8e9b5c0640053933e.zip |
AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
Diffstat (limited to 'Userland/Applications/ThemeEditor')
-rw-r--r-- | Userland/Applications/ThemeEditor/MainWidget.cpp | 10 | ||||
-rw-r--r-- | Userland/Applications/ThemeEditor/MainWidget.h | 12 | ||||
-rw-r--r-- | Userland/Applications/ThemeEditor/main.cpp | 4 |
3 files changed, 13 insertions, 13 deletions
diff --git a/Userland/Applications/ThemeEditor/MainWidget.cpp b/Userland/Applications/ThemeEditor/MainWidget.cpp index 4006456491..86f888f3ac 100644 --- a/Userland/Applications/ThemeEditor/MainWidget.cpp +++ b/Userland/Applications/ThemeEditor/MainWidget.cpp @@ -250,7 +250,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window) void MainWidget::update_title() { - window()->set_title(String::formatted("{}[*] - Theme Editor", m_path.value_or("Untitled"))); + window()->set_title(DeprecatedString::formatted("{}[*] - Theme Editor", m_path.value_or("Untitled"))); } GUI::Window::CloseRequestDecision MainWidget::request_close() @@ -272,7 +272,7 @@ GUI::Window::CloseRequestDecision MainWidget::request_close() return GUI::Window::CloseRequestDecision::StayOpen; } -void MainWidget::set_path(String path) +void MainWidget::set_path(DeprecatedString path) { m_path = path; update_title(); @@ -304,7 +304,7 @@ void MainWidget::save_to_file(Core::File& file) auto sync_result = theme->sync(); if (sync_result.is_error()) { - GUI::MessageBox::show_error(window(), String::formatted("Failed to save theme file: {}", sync_result.error())); + GUI::MessageBox::show_error(window(), DeprecatedString::formatted("Failed to save theme file: {}", sync_result.error())); } else { m_last_modified_time = Time::now_monotonic(); set_path(file.filename()); @@ -525,7 +525,7 @@ void MainWidget::set_metric(Gfx::MetricRole role, int value) set_palette(preview_palette); } -void MainWidget::set_path(Gfx::PathRole role, String value) +void MainWidget::set_path(Gfx::PathRole role, DeprecatedString value) { auto preview_palette = m_current_palette; preview_palette.set_path(role, value); @@ -543,7 +543,7 @@ void MainWidget::set_palette(Gfx::Palette palette) void MainWidget::show_path_picker_dialog(StringView property_display_name, GUI::TextBox& path_input, PathPickerTarget path_picker_target) { bool open_folder = path_picker_target == PathPickerTarget::Folder; - auto window_title = String::formatted(open_folder ? "Select {} folder"sv : "Select {} file"sv, property_display_name); + auto window_title = DeprecatedString::formatted(open_folder ? "Select {} folder"sv : "Select {} file"sv, property_display_name); auto target_path = path_input.text(); if (Core::File::exists(target_path)) { if (!Core::File::is_directory(target_path)) diff --git a/Userland/Applications/ThemeEditor/MainWidget.h b/Userland/Applications/ThemeEditor/MainWidget.h index a54a36578d..28befade58 100644 --- a/Userland/Applications/ThemeEditor/MainWidget.h +++ b/Userland/Applications/ThemeEditor/MainWidget.h @@ -52,7 +52,7 @@ private: AlignmentModel() = default; struct AlignmentValue { - String title; + DeprecatedString title; Gfx::TextAlignment setting_value; }; Vector<AlignmentValue> m_alignments { @@ -67,12 +67,12 @@ struct Property { }; struct PropertyGroup { - String title; + DeprecatedString title; Vector<Property> properties; }; struct PropertyTab { - String title; + DeprecatedString title; Vector<PropertyGroup> property_groups; }; @@ -92,7 +92,7 @@ private: void save_to_file(Core::File&); ErrorOr<Core::AnonymousBuffer> encode(); - void set_path(String); + void set_path(DeprecatedString); void build_override_controls(); @@ -101,7 +101,7 @@ private: void set_color(Gfx::ColorRole, Gfx::Color); void set_flag(Gfx::FlagRole, bool); void set_metric(Gfx::MetricRole, int); - void set_path(Gfx::PathRole, String); + void set_path(Gfx::PathRole, DeprecatedString); void set_palette(Gfx::Palette); @@ -118,7 +118,7 @@ private: RefPtr<GUI::Button> m_theme_override_apply; RefPtr<GUI::Button> m_theme_override_reset; - Optional<String> m_path; + Optional<DeprecatedString> m_path; Gfx::Palette m_current_palette; Time m_last_modified_time { Time::now_monotonic() }; diff --git a/Userland/Applications/ThemeEditor/main.cpp b/Userland/Applications/ThemeEditor/main.cpp index 1b904355e1..1e60a885c5 100644 --- a/Userland/Applications/ThemeEditor/main.cpp +++ b/Userland/Applications/ThemeEditor/main.cpp @@ -33,7 +33,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) parser.add_positional_argument(file_to_edit, "Theme file to edit", "file", Core::ArgsParser::Required::No); parser.parse(arguments); - Optional<String> path = {}; + Optional<DeprecatedString> path = {}; if (!file_to_edit.is_empty()) path = Core::File::absolute_path(file_to_edit); @@ -55,7 +55,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) [&window, &path, &main_widget]() { auto response = FileSystemAccessClient::Client::the().try_request_file_read_only_approved(window, path.value()); if (response.is_error()) - GUI::MessageBox::show_error(window, String::formatted("Opening \"{}\" failed: {}", path.value(), response.error())); + GUI::MessageBox::show_error(window, DeprecatedString::formatted("Opening \"{}\" failed: {}", path.value(), response.error())); else main_widget->load_from_file(response.release_value()); }); |