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/Libraries/LibFileSystemAccessClient | |
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/Libraries/LibFileSystemAccessClient')
-rw-r--r-- | Userland/Libraries/LibFileSystemAccessClient/Client.cpp | 18 | ||||
-rw-r--r-- | Userland/Libraries/LibFileSystemAccessClient/Client.h | 10 |
2 files changed, 14 insertions, 14 deletions
diff --git a/Userland/Libraries/LibFileSystemAccessClient/Client.cpp b/Userland/Libraries/LibFileSystemAccessClient/Client.cpp index 3c6f68bc34..d689545342 100644 --- a/Userland/Libraries/LibFileSystemAccessClient/Client.cpp +++ b/Userland/Libraries/LibFileSystemAccessClient/Client.cpp @@ -23,7 +23,7 @@ Client& Client::the() return *s_the; } -Result Client::try_request_file_read_only_approved(GUI::Window* parent_window, String const& path) +Result Client::try_request_file_read_only_approved(GUI::Window* parent_window, DeprecatedString const& path) { auto const id = get_new_id(); m_promises.set(id, PromiseAndWindow { Core::Promise<Result>::construct(), parent_window }); @@ -48,7 +48,7 @@ Result Client::try_request_file_read_only_approved(GUI::Window* parent_window, S return handle_promise(id); } -Result Client::try_request_file(GUI::Window* parent_window, String const& path, Core::OpenMode mode) +Result Client::try_request_file(GUI::Window* parent_window, DeprecatedString const& path, Core::OpenMode mode) { auto const id = get_new_id(); m_promises.set(id, PromiseAndWindow { Core::Promise<Result>::construct(), parent_window }); @@ -73,7 +73,7 @@ Result Client::try_request_file(GUI::Window* parent_window, String const& path, return handle_promise(id); } -Result Client::try_open_file(GUI::Window* parent_window, String const& window_title, StringView path, Core::OpenMode requested_access) +Result Client::try_open_file(GUI::Window* parent_window, DeprecatedString const& window_title, StringView path, Core::OpenMode requested_access) { auto const id = get_new_id(); m_promises.set(id, PromiseAndWindow { Core::Promise<Result>::construct(), parent_window }); @@ -93,7 +93,7 @@ Result Client::try_open_file(GUI::Window* parent_window, String const& window_ti return handle_promise(id); } -Result Client::try_save_file(GUI::Window* parent_window, String const& name, String const ext, Core::OpenMode requested_access) +Result Client::try_save_file(GUI::Window* parent_window, DeprecatedString const& name, DeprecatedString const ext, Core::OpenMode requested_access) { auto const id = get_new_id(); m_promises.set(id, PromiseAndWindow { Core::Promise<Result>::construct(), parent_window }); @@ -113,7 +113,7 @@ Result Client::try_save_file(GUI::Window* parent_window, String const& name, Str return handle_promise(id); } -void Client::handle_prompt_end(i32 request_id, i32 error, Optional<IPC::File> const& ipc_file, Optional<String> const& chosen_file) +void Client::handle_prompt_end(i32 request_id, i32 error, Optional<IPC::File> const& ipc_file, Optional<DeprecatedString> const& chosen_file) { auto potential_data = m_promises.get(request_id); VERIFY(potential_data.has_value()); @@ -122,7 +122,7 @@ void Client::handle_prompt_end(i32 request_id, i32 error, Optional<IPC::File> co // We don't want to show an error message for non-existent files since some applications may want // to handle it as opening a new, named file. if (error != -1 && error != ENOENT) - GUI::MessageBox::show_error(request_data.parent_window, String::formatted("Opening \"{}\" failed: {}", *chosen_file, strerror(error))); + GUI::MessageBox::show_error(request_data.parent_window, DeprecatedString::formatted("Opening \"{}\" failed: {}", *chosen_file, strerror(error))); request_data.promise->resolve(Error::from_errno(error)); return; } @@ -130,19 +130,19 @@ void Client::handle_prompt_end(i32 request_id, i32 error, Optional<IPC::File> co auto file = Core::File::construct(); auto fd = ipc_file->take_fd(); if (!file->open(fd, Core::OpenMode::ReadWrite, Core::File::ShouldCloseFileDescriptor::Yes) && file->error() != ENOENT) { - GUI::MessageBox::show_error(request_data.parent_window, String::formatted("Opening \"{}\" failed: {}", *chosen_file, strerror(error))); + GUI::MessageBox::show_error(request_data.parent_window, DeprecatedString::formatted("Opening \"{}\" failed: {}", *chosen_file, strerror(error))); request_data.promise->resolve(Error::from_errno(file->error())); return; } if (file->is_device()) { - GUI::MessageBox::show_error(request_data.parent_window, String::formatted("Opening \"{}\" failed: Cannot open device files", *chosen_file)); + GUI::MessageBox::show_error(request_data.parent_window, DeprecatedString::formatted("Opening \"{}\" failed: Cannot open device files", *chosen_file)); request_data.promise->resolve(Error::from_string_literal("Cannot open device files")); return; } if (file->is_directory()) { - GUI::MessageBox::show_error(request_data.parent_window, String::formatted("Opening \"{}\" failed: Cannot open directory", *chosen_file)); + GUI::MessageBox::show_error(request_data.parent_window, DeprecatedString::formatted("Opening \"{}\" failed: Cannot open directory", *chosen_file)); request_data.promise->resolve(Error::from_errno(EISDIR)); return; } diff --git a/Userland/Libraries/LibFileSystemAccessClient/Client.h b/Userland/Libraries/LibFileSystemAccessClient/Client.h index 8525c106f7..dbabcc71b3 100644 --- a/Userland/Libraries/LibFileSystemAccessClient/Client.h +++ b/Userland/Libraries/LibFileSystemAccessClient/Client.h @@ -26,10 +26,10 @@ class Client final IPC_CLIENT_CONNECTION(Client, "/tmp/session/%sid/portal/filesystemaccess"sv) public: - Result try_request_file_read_only_approved(GUI::Window* parent_window, String const& path); - Result try_request_file(GUI::Window* parent_window, String const& path, Core::OpenMode mode); - Result try_open_file(GUI::Window* parent_window, String const& window_title = {}, StringView path = Core::StandardPaths::home_directory(), Core::OpenMode requested_access = Core::OpenMode::ReadOnly); - Result try_save_file(GUI::Window* parent_window, String const& name, String const ext, Core::OpenMode requested_access = Core::OpenMode::WriteOnly | Core::OpenMode::Truncate); + Result try_request_file_read_only_approved(GUI::Window* parent_window, DeprecatedString const& path); + Result try_request_file(GUI::Window* parent_window, DeprecatedString const& path, Core::OpenMode mode); + Result try_open_file(GUI::Window* parent_window, DeprecatedString const& window_title = {}, StringView path = Core::StandardPaths::home_directory(), Core::OpenMode requested_access = Core::OpenMode::ReadOnly); + Result try_save_file(GUI::Window* parent_window, DeprecatedString const& name, DeprecatedString const ext, Core::OpenMode requested_access = Core::OpenMode::WriteOnly | Core::OpenMode::Truncate); static Client& the(); @@ -42,7 +42,7 @@ private: { } - virtual void handle_prompt_end(i32 request_id, i32 error, Optional<IPC::File> const& fd, Optional<String> const& chosen_file) override; + virtual void handle_prompt_end(i32 request_id, i32 error, Optional<IPC::File> const& fd, Optional<DeprecatedString> const& chosen_file) override; int get_new_id(); Result handle_promise(int); |