From bd66453e8dd48104f2f1cd9bf0f2dc6666939f29 Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Fri, 23 Sep 2022 10:34:06 -0400 Subject: [PATCH] LibCore: Add documents_directory() to StandardPaths --- Userland/Libraries/LibCore/StandardPaths.cpp | 8 ++++++++ Userland/Libraries/LibCore/StandardPaths.h | 1 + 2 files changed, 9 insertions(+) diff --git a/Userland/Libraries/LibCore/StandardPaths.cpp b/Userland/Libraries/LibCore/StandardPaths.cpp index 2398b6f925..9adc689794 100644 --- a/Userland/Libraries/LibCore/StandardPaths.cpp +++ b/Userland/Libraries/LibCore/StandardPaths.cpp @@ -33,6 +33,14 @@ String StandardPaths::desktop_directory() return LexicalPath::canonicalized_path(builder.to_string()); } +String StandardPaths::documents_directory() +{ + StringBuilder builder; + builder.append(home_directory()); + builder.append("/Documents"sv); + return LexicalPath::canonicalized_path(builder.to_string()); +} + String StandardPaths::downloads_directory() { StringBuilder builder; diff --git a/Userland/Libraries/LibCore/StandardPaths.h b/Userland/Libraries/LibCore/StandardPaths.h index 80934cfe94..34a637adcb 100644 --- a/Userland/Libraries/LibCore/StandardPaths.h +++ b/Userland/Libraries/LibCore/StandardPaths.h @@ -14,6 +14,7 @@ class StandardPaths { public: static String home_directory(); static String desktop_directory(); + static String documents_directory(); static String downloads_directory(); static String tempfile_directory(); static String config_directory();