From 862256548050dd4e40c3e0ffd5be48a646a50b7f Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Fri, 22 Jan 2021 23:35:09 -0500 Subject: [PATCH] Add GetUserConfigDir --- common/paths.cpp | 1 + libs/kiplatform/gtk/environment.cpp | 6 ++++++ libs/kiplatform/include/kiplatform/environment.h | 2 ++ libs/kiplatform/msw/environment.cpp | 6 ++++++ libs/kiplatform/osx/environment.mm | 6 ++++++ 5 files changed, 21 insertions(+) diff --git a/common/paths.cpp b/common/paths.cpp index 120ea9384d..d6ae06c316 100644 --- a/common/paths.cpp +++ b/common/paths.cpp @@ -6,6 +6,7 @@ #include #include + wxString PATHS::GetUserScriptingPath() { wxFileName tmp; diff --git a/libs/kiplatform/gtk/environment.cpp b/libs/kiplatform/gtk/environment.cpp index 41919d756d..6cc831509f 100644 --- a/libs/kiplatform/gtk/environment.cpp +++ b/libs/kiplatform/gtk/environment.cpp @@ -51,4 +51,10 @@ bool KIPLATFORM::ENV::IsNetworkPath( const wxString& aPath ) wxString KIPLATFORM::ENV::GetDocumentsDir() { return g_get_user_special_dir( G_USER_DIRECTORY_DOCUMENTS ); +} + + +wxString KIPLATFORM::ENV::GetUserConfigDir() +{ + return g_get_user_config_dir(); } \ No newline at end of file diff --git a/libs/kiplatform/include/kiplatform/environment.h b/libs/kiplatform/include/kiplatform/environment.h index 92f6426fb5..c72c1d46bb 100644 --- a/libs/kiplatform/include/kiplatform/environment.h +++ b/libs/kiplatform/include/kiplatform/environment.h @@ -53,5 +53,7 @@ namespace KIPLATFORM * @return Path for the given aPath */ wxString GetDocumentsDir(); + + wxString GetUserConfigDir(); } } diff --git a/libs/kiplatform/msw/environment.cpp b/libs/kiplatform/msw/environment.cpp index 1629fd280c..02ecd685db 100644 --- a/libs/kiplatform/msw/environment.cpp +++ b/libs/kiplatform/msw/environment.cpp @@ -63,4 +63,10 @@ bool KIPLATFORM::ENV::IsNetworkPath( const wxString& aPath ) wxString KIPLATFORM::ENV::GetDocumentsDir() { return wxStandardPaths::Get().GetDocumentsDir(); +} + + +wxString KIPLATFORM::ENV::GetUserConfigDir() +{ + return wxStandardPaths::Get().GetUserConfigDir(); } \ No newline at end of file diff --git a/libs/kiplatform/osx/environment.mm b/libs/kiplatform/osx/environment.mm index 011a7f57a0..235f127c8c 100644 --- a/libs/kiplatform/osx/environment.mm +++ b/libs/kiplatform/osx/environment.mm @@ -55,4 +55,10 @@ bool KIPLATFORM::ENV::IsNetworkPath( const wxString& aPath ) wxString KIPLATFORM::ENV::GetDocumentsDir() { return wxStandardPaths::Get().GetDocumentsDir(); +} + + +wxString KIPLATFORM::ENV::GetUserConfigDir() +{ + return wxStandardPaths::Get().GetUserConfigDir(); } \ No newline at end of file