diff options
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibGUI/FilePicker.cpp | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/FilePicker.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibGUI/FilePicker.cpp b/Userland/Libraries/LibGUI/FilePicker.cpp index fbca7fc9a2..4ca510d4a4 100644 --- a/Userland/Libraries/LibGUI/FilePicker.cpp +++ b/Userland/Libraries/LibGUI/FilePicker.cpp @@ -48,9 +48,9 @@ namespace GUI { -Optional<String> FilePicker::get_open_filepath(Window* parent_window, const String& window_title) +Optional<String> FilePicker::get_open_filepath(Window* parent_window, const String& window_title, const StringView& path) { - auto picker = FilePicker::construct(parent_window, Mode::Open); + auto picker = FilePicker::construct(parent_window, Mode::Open, "", path); if (!window_title.is_null()) picker->set_title(window_title); @@ -66,9 +66,9 @@ Optional<String> FilePicker::get_open_filepath(Window* parent_window, const Stri return {}; } -Optional<String> FilePicker::get_save_filepath(Window* parent_window, const String& title, const String& extension) +Optional<String> FilePicker::get_save_filepath(Window* parent_window, const String& title, const String& extension, const StringView& path) { - auto picker = FilePicker::construct(parent_window, Mode::Save, String::formatted("{}.{}", title, extension)); + auto picker = FilePicker::construct(parent_window, Mode::Save, String::formatted("{}.{}", title, extension), path); if (picker->exec() == Dialog::ExecOK) { String file_path = picker->selected_file().string(); diff --git a/Userland/Libraries/LibGUI/FilePicker.h b/Userland/Libraries/LibGUI/FilePicker.h index ce1de94f32..ee4614ba2d 100644 --- a/Userland/Libraries/LibGUI/FilePicker.h +++ b/Userland/Libraries/LibGUI/FilePicker.h @@ -47,8 +47,8 @@ public: Save }; - static Optional<String> get_open_filepath(Window* parent_window, const String& window_title = {}); - static Optional<String> get_save_filepath(Window* parent_window, const String& title, const String& extension); + static Optional<String> get_open_filepath(Window* parent_window, const String& window_title = {}, const StringView& path = Core::StandardPaths::home_directory()); + static Optional<String> get_save_filepath(Window* parent_window, const String& title, const String& extension, const StringView& path = Core::StandardPaths::home_directory()); virtual ~FilePicker() override; |