diff options
author | Lucas CHOLLET <lucas.chollet@free.fr> | 2022-12-07 22:51:37 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-12-14 18:26:25 +0000 |
commit | c71fc0683f5b421bc994ff1b480c31680a6fc3fc (patch) | |
tree | 96d6ad9fb613665ed1f7bfaf3a9d30895f77c7fd /Userland | |
parent | 806a55eda1d2e76c52fcea2ef11b81f2967b6e74 (diff) | |
download | serenity-c71fc0683f5b421bc994ff1b480c31680a6fc3fc.zip |
LibFileSystemAccessClient: Rename `Result` => `DeprecatedResult`
This precedes the addition of a new `Result`, using `Core::Stream::File`
instead `Core::File`.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibFileSystemAccessClient/Client.cpp | 18 | ||||
-rw-r--r-- | Userland/Libraries/LibFileSystemAccessClient/Client.h | 14 |
2 files changed, 16 insertions, 16 deletions
diff --git a/Userland/Libraries/LibFileSystemAccessClient/Client.cpp b/Userland/Libraries/LibFileSystemAccessClient/Client.cpp index d689545342..dc3961797b 100644 --- a/Userland/Libraries/LibFileSystemAccessClient/Client.cpp +++ b/Userland/Libraries/LibFileSystemAccessClient/Client.cpp @@ -23,10 +23,10 @@ Client& Client::the() return *s_the; } -Result Client::try_request_file_read_only_approved(GUI::Window* parent_window, DeprecatedString const& path) +DeprecatedResult 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 }); + m_promises.set(id, PromiseAndWindow { Core::Promise<DeprecatedResult>::construct(), parent_window }); auto parent_window_server_client_id = GUI::ConnectionToWindowServer::the().expose_client_id(); auto child_window_server_client_id = expose_window_server_client_id(); @@ -48,10 +48,10 @@ Result Client::try_request_file_read_only_approved(GUI::Window* parent_window, D return handle_promise(id); } -Result Client::try_request_file(GUI::Window* parent_window, DeprecatedString const& path, Core::OpenMode mode) +DeprecatedResult 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 }); + m_promises.set(id, PromiseAndWindow { Core::Promise<DeprecatedResult>::construct(), parent_window }); auto parent_window_server_client_id = GUI::ConnectionToWindowServer::the().expose_client_id(); auto child_window_server_client_id = expose_window_server_client_id(); @@ -73,10 +73,10 @@ Result Client::try_request_file(GUI::Window* parent_window, DeprecatedString con return handle_promise(id); } -Result Client::try_open_file(GUI::Window* parent_window, DeprecatedString const& window_title, StringView path, Core::OpenMode requested_access) +DeprecatedResult 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 }); + m_promises.set(id, PromiseAndWindow { Core::Promise<DeprecatedResult>::construct(), parent_window }); auto parent_window_server_client_id = GUI::ConnectionToWindowServer::the().expose_client_id(); auto child_window_server_client_id = expose_window_server_client_id(); @@ -93,10 +93,10 @@ Result Client::try_open_file(GUI::Window* parent_window, DeprecatedString const& return handle_promise(id); } -Result Client::try_save_file(GUI::Window* parent_window, DeprecatedString const& name, DeprecatedString const ext, Core::OpenMode requested_access) +DeprecatedResult 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 }); + m_promises.set(id, PromiseAndWindow { Core::Promise<DeprecatedResult>::construct(), parent_window }); auto parent_window_server_client_id = GUI::ConnectionToWindowServer::the().expose_client_id(); auto child_window_server_client_id = expose_window_server_client_id(); @@ -166,7 +166,7 @@ int Client::get_new_id() return new_id; } -Result Client::handle_promise(int id) +DeprecatedResult Client::handle_promise(int id) { auto result = m_promises.get(id)->promise->await(); m_promises.remove(id); diff --git a/Userland/Libraries/LibFileSystemAccessClient/Client.h b/Userland/Libraries/LibFileSystemAccessClient/Client.h index dbabcc71b3..5cc4585f18 100644 --- a/Userland/Libraries/LibFileSystemAccessClient/Client.h +++ b/Userland/Libraries/LibFileSystemAccessClient/Client.h @@ -18,7 +18,7 @@ namespace FileSystemAccessClient { -using Result = ErrorOr<NonnullRefPtr<Core::File>>; +using DeprecatedResult = ErrorOr<NonnullRefPtr<Core::File>>; class Client final : public IPC::ConnectionToServer<FileSystemAccessClientEndpoint, FileSystemAccessServerEndpoint> @@ -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, 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); + DeprecatedResult try_request_file_read_only_approved(GUI::Window* parent_window, DeprecatedString const& path); + DeprecatedResult try_request_file(GUI::Window* parent_window, DeprecatedString const& path, Core::OpenMode mode); + DeprecatedResult try_open_file(GUI::Window* parent_window, DeprecatedString const& window_title = {}, StringView path = Core::StandardPaths::home_directory(), Core::OpenMode requested_access = Core::OpenMode::ReadOnly); + DeprecatedResult 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(); @@ -45,10 +45,10 @@ private: 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); + DeprecatedResult handle_promise(int); struct PromiseAndWindow { - RefPtr<Core::Promise<Result>> promise {}; + RefPtr<Core::Promise<DeprecatedResult>> promise {}; GUI::Window* parent_window { nullptr }; }; |