1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:28:11 +00:00

LibCore: Add StandardPaths thing to retrieve various standard locations

Fixes #1853.
This commit is contained in:
Andreas Kling 2020-04-19 19:57:05 +02:00
parent 3b434068eb
commit c45e16f605
10 changed files with 51 additions and 25 deletions

View file

@ -128,7 +128,7 @@ FilePicker::FilePicker(Mode mode, const StringView& file_name, const StringView&
toolbar.add_action(*open_parent_directory_action);
auto go_home_action = CommonActions::make_go_home_action([this](auto&) {
m_model->set_root_path(get_current_user_home_path());
m_model->set_root_path(Core::StandardPaths::home_directory());
});
toolbar.add_action(go_home_action);
toolbar.add_separator();

View file

@ -26,7 +26,7 @@
#include <AK/FileSystemPath.h>
#include <AK/Optional.h>
#include <LibCore/UserInfo.h>
#include <LibCore/StandardPaths.h>
#include <LibGUI/Dialog.h>
namespace GUI {
@ -52,7 +52,7 @@ private:
void clear_preview();
void on_file_return();
FilePicker(Mode type = Mode::Open, const StringView& file_name = "Untitled", const StringView& path = String(get_current_user_home_path()), Window* parent_window = nullptr);
FilePicker(Mode type = Mode::Open, const StringView& file_name = "Untitled", const StringView& path = Core::StandardPaths::home_directory(), Window* parent_window = nullptr);
static String ok_button_name(Mode mode)
{