From 6e19ab2bbce0b113b628e6f8e9b5c0640053933e Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 4 Dec 2022 18:02:33 +0000 Subject: 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 :^) --- Userland/Applications/Run/RunWindow.cpp | 16 ++++++++-------- Userland/Applications/Run/RunWindow.h | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'Userland/Applications/Run') diff --git a/Userland/Applications/Run/RunWindow.cpp b/Userland/Applications/Run/RunWindow.cpp index bd10c91972..11b6f9231e 100644 --- a/Userland/Applications/Run/RunWindow.cpp +++ b/Userland/Applications/Run/RunWindow.cpp @@ -28,7 +28,7 @@ RunWindow::RunWindow() : m_path_history() - , m_path_history_model(GUI::ItemListModel::create(m_path_history)) + , m_path_history_model(GUI::ItemListModel::create(m_path_history)) { // FIXME: Handle failure to load history somehow. (void)load_history(); @@ -65,7 +65,7 @@ RunWindow::RunWindow() m_browse_button = *find_descendant_of_type_named("browse_button"); m_browse_button->on_click = [this](auto) { - Optional path = GUI::FilePicker::get_open_filepath(this, {}, Core::StandardPaths::home_directory(), false, GUI::Dialog::ScreenPosition::Center); + Optional path = GUI::FilePicker::get_open_filepath(this, {}, Core::StandardPaths::home_directory(), false, GUI::Dialog::ScreenPosition::Center); if (path.has_value()) m_path_combo_box->set_text(path.value().view()); }; @@ -95,7 +95,7 @@ void RunWindow::do_run() if (run_via_launch(run_input) || run_as_command(run_input)) { // Remove any existing history entry, prepend the successful run string to history and save. - m_path_history.remove_all_matching([&](String v) { return v == run_input; }); + m_path_history.remove_all_matching([&](DeprecatedString v) { return v == run_input; }); m_path_history.prepend(run_input); // FIXME: Handle failure to save history somehow. (void)save_history(); @@ -109,7 +109,7 @@ void RunWindow::do_run() show(); } -bool RunWindow::run_as_command(String const& run_input) +bool RunWindow::run_as_command(DeprecatedString const& run_input) { pid_t child_pid; char const* shell_executable = "/bin/Shell"; // TODO query and use the user's preferred shell. @@ -138,7 +138,7 @@ bool RunWindow::run_as_command(String const& run_input) return true; } -bool RunWindow::run_via_launch(String const& run_input) +bool RunWindow::run_via_launch(DeprecatedString const& run_input) { auto url = URL::create_with_url_or_path(run_input); @@ -162,9 +162,9 @@ bool RunWindow::run_via_launch(String const& run_input) return true; } -String RunWindow::history_file_path() +DeprecatedString RunWindow::history_file_path() { - return LexicalPath::canonicalized_path(String::formatted("{}/{}", Core::StandardPaths::config_directory(), "RunHistory.txt")); + return LexicalPath::canonicalized_path(DeprecatedString::formatted("{}/{}", Core::StandardPaths::config_directory(), "RunHistory.txt")); } ErrorOr RunWindow::load_history() @@ -188,7 +188,7 @@ ErrorOr RunWindow::save_history() // Write the first 25 items of history for (int i = 0; i < min(static_cast(m_path_history.size()), 25); i++) - TRY(file->write(String::formatted("{}\n", m_path_history[i]).bytes())); + TRY(file->write(DeprecatedString::formatted("{}\n", m_path_history[i]).bytes())); return {}; } diff --git a/Userland/Applications/Run/RunWindow.h b/Userland/Applications/Run/RunWindow.h index 5ae6b483e1..2869407393 100644 --- a/Userland/Applications/Run/RunWindow.h +++ b/Userland/Applications/Run/RunWindow.h @@ -24,15 +24,15 @@ private: RunWindow(); void do_run(); - bool run_as_command(String const& run_input); - bool run_via_launch(String const& run_input); + bool run_as_command(DeprecatedString const& run_input); + bool run_via_launch(DeprecatedString const& run_input); - String history_file_path(); + DeprecatedString history_file_path(); ErrorOr load_history(); ErrorOr save_history(); - Vector m_path_history; - NonnullRefPtr> m_path_history_model; + Vector m_path_history; + NonnullRefPtr> m_path_history_model; RefPtr m_icon_image_widget; RefPtr m_ok_button; -- cgit v1.2.3