summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibFileSystemAccessClient
diff options
context:
space:
mode:
authorTimothy <timmot@users.noreply.github.com>2021-08-06 11:34:14 +1000
committerAndreas Kling <kling@serenityos.org>2021-08-07 12:48:22 +0200
commit95ee7069d536d5619c6078b13fd2c5eead96e390 (patch)
treeabf62f8bfafd38440160a13d9fb3271824e01512 /Userland/Libraries/LibFileSystemAccessClient
parentd496eb48e3ae3cafaa0da706e6ca6679a275b084 (diff)
downloadserenity-95ee7069d536d5619c6078b13fd2c5eead96e390.zip
FileSystemAccessServer: Add window title as parameter for opening file
Diffstat (limited to 'Userland/Libraries/LibFileSystemAccessClient')
-rw-r--r--Userland/Libraries/LibFileSystemAccessClient/Client.cpp5
-rw-r--r--Userland/Libraries/LibFileSystemAccessClient/Client.h3
2 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibFileSystemAccessClient/Client.cpp b/Userland/Libraries/LibFileSystemAccessClient/Client.cpp
index 70eb4846c9..a18b2ed357 100644
--- a/Userland/Libraries/LibFileSystemAccessClient/Client.cpp
+++ b/Userland/Libraries/LibFileSystemAccessClient/Client.cpp
@@ -8,7 +8,6 @@
// clang-format off
#include <LibGUI/WindowServerConnection.h>
// clang-format on
-#include <LibCore/StandardPaths.h>
#include <LibFileSystemAccessClient/Client.h>
#include <LibGUI/Window.h>
@@ -40,7 +39,7 @@ Result Client::request_file(i32 parent_window_id, String const& path, Core::Open
return m_promise->await();
}
-Result Client::open_file(i32 parent_window_id)
+Result Client::open_file(i32 parent_window_id, String const& window_title, StringView const& path)
{
m_promise = Core::Promise<Result>::construct();
auto parent_window_server_client_id = GUI::WindowServerConnection::the().expose_client_id();
@@ -52,7 +51,7 @@ Result Client::open_file(i32 parent_window_id)
GUI::WindowServerConnection::the().async_remove_window_stealing_for_client(child_window_server_client_id, parent_window_id);
});
- async_prompt_open_file(parent_window_server_client_id, parent_window_id, Core::StandardPaths::home_directory(), Core::OpenMode::ReadOnly);
+ async_prompt_open_file(parent_window_server_client_id, parent_window_id, window_title, path, Core::OpenMode::ReadOnly);
return m_promise->await();
}
diff --git a/Userland/Libraries/LibFileSystemAccessClient/Client.h b/Userland/Libraries/LibFileSystemAccessClient/Client.h
index 3fb7feb04f..b2b418fd54 100644
--- a/Userland/Libraries/LibFileSystemAccessClient/Client.h
+++ b/Userland/Libraries/LibFileSystemAccessClient/Client.h
@@ -10,6 +10,7 @@
#include <FileSystemAccessServer/FileSystemAccessServerEndpoint.h>
#include <LibCore/File.h>
#include <LibCore/Promise.h>
+#include <LibCore/StandardPaths.h>
#include <LibIPC/ServerConnection.h>
namespace FileSystemAccessClient {
@@ -27,7 +28,7 @@ class Client final
public:
Result request_file(i32 parent_window_id, String const& path, Core::OpenMode mode);
- Result open_file(i32 parent_window_id);
+ Result open_file(i32 parent_window_id, String const& window_title = {}, StringView const& path = Core::StandardPaths::home_directory());
Result save_file(i32 parent_window_id, String const& name, String const ext);
static Client& the();