diff options
author | Lucas CHOLLET <lucas.chollet@free.fr> | 2023-01-15 00:05:46 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-16 20:11:52 +0100 |
commit | e8249d735d5133174bd992255312f27d22f4282c (patch) | |
tree | fc009accc35e43e68d62c43993047c136799ba29 /Userland/Libraries/LibFileSystemAccessClient/Client.h | |
parent | ba40ef1f3a87bc61376178778afd88e15f944fcb (diff) | |
download | serenity-e8249d735d5133174bd992255312f27d22f4282c.zip |
LibFileSystemAccessClient: Remove the deprecated API
Concerned functions are:
- try_request_file_read_only_approved_deprecated
- try_request_file_deprecated
- try_open_file_deprecated
- try_save_file_deprecated
It also allows some simplifications in the implementation of the client.
Diffstat (limited to 'Userland/Libraries/LibFileSystemAccessClient/Client.h')
-rw-r--r-- | Userland/Libraries/LibFileSystemAccessClient/Client.h | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/Userland/Libraries/LibFileSystemAccessClient/Client.h b/Userland/Libraries/LibFileSystemAccessClient/Client.h index c5e5f18418..daf6c6f967 100644 --- a/Userland/Libraries/LibFileSystemAccessClient/Client.h +++ b/Userland/Libraries/LibFileSystemAccessClient/Client.h @@ -11,7 +11,7 @@ #include <AK/String.h> #include <FileSystemAccessServer/FileSystemAccessClientEndpoint.h> #include <FileSystemAccessServer/FileSystemAccessServerEndpoint.h> -#include <LibCore/DeprecatedFile.h> +#include <LibCore/File.h> #include <LibCore/Promise.h> #include <LibCore/StandardPaths.h> #include <LibGUI/Window.h> @@ -37,7 +37,6 @@ private: String m_filename; }; -using DeprecatedResult = ErrorOr<NonnullRefPtr<Core::DeprecatedFile>>; using Result = ErrorOr<File>; class Client final @@ -46,11 +45,6 @@ class Client final IPC_CLIENT_CONNECTION(Client, "/tmp/session/%sid/portal/filesystemaccess"sv) public: - DeprecatedResult try_request_file_read_only_approved_deprecated(GUI::Window* parent_window, DeprecatedString const& path); - DeprecatedResult try_request_file_deprecated(GUI::Window* parent_window, DeprecatedString const& path, Core::OpenMode mode); - DeprecatedResult try_open_file_deprecated(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_deprecated(GUI::Window* parent_window, DeprecatedString const& name, DeprecatedString const ext, Core::OpenMode requested_access = Core::OpenMode::WriteOnly | Core::OpenMode::Truncate); - Result request_file_read_only_approved(GUI::Window* parent_window, DeprecatedString const& path); Result request_file(GUI::Window* parent_window, DeprecatedString const& path, Core::File::OpenMode requested_access); Result open_file(GUI::Window* parent_window, DeprecatedString const& window_title = {}, StringView path = Core::StandardPaths::home_directory(), Core::File::OpenMode requested_access = Core::File::OpenMode::Read); @@ -70,14 +64,13 @@ 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(); - template<typename AnyResult> - AnyResult handle_promise(int); + Result handle_promise(int); template<typename T> using PromiseType = RefPtr<Core::Promise<T>>; struct PromiseAndWindow { - Variant<PromiseType<DeprecatedResult>, PromiseType<Result>> promise; + PromiseType<Result> promise; GUI::Window* parent_window { nullptr }; }; |