From 663dfa46715f808a30c2909038041e1dab848c6c Mon Sep 17 00:00:00 2001 From: Mart Raudsepp Date: Fri, 20 Aug 2021 22:53:45 +0300 Subject: [PATCH] FileNames: Support XDG paths handling under wxGTK 3.0 Signed-off-by: Mart Raudsepp --- src/AudacityApp.cpp | 2 ++ src/FileNames.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp index 6893bf64c..4fab923aa 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp @@ -1049,7 +1049,9 @@ bool AudacityApp::OnInit() { wxFileSystem::AddHandler(safenew wxZipFSHandler); // encouraged by wxwidgets +#if wxCHECK_VERSION(3, 1, 1) wxStandardPaths::Get().SetFileLayout(wxStandardPaths::FileLayout::FileLayout_XDG); +#endif // // Paths: set search path and temp dir path diff --git a/src/FileNames.cpp b/src/FileNames.cpp index 9a0face8f..4c5b8ea9d 100644 --- a/src/FileNames.cpp +++ b/src/FileNames.cpp @@ -47,6 +47,10 @@ used throughout Audacity into this one place. #include #endif +#if defined(__WXGTK__) && !wxCHECK_VERSION(3, 1, 1) +#include +#endif + static wxString gConfigDir; static wxString gDataDir; @@ -246,6 +250,8 @@ FilePath FileNames::ConfigDir() // Use OS-provided user data dir folder #if defined(__WXMSW__) wxString configDir(wxStandardPaths::Get().GetUserConfigDir() + wxT("\\Tenacity")); +#elif defined(__WXGTK__) && !wxCHECK_VERSION(3, 1, 1) + wxString configDir = wxString::Format(wxT("%s/tenacity"), g_get_user_config_dir()); #else wxString configDir(wxStandardPaths::Get().GetUserConfigDir() + wxT("/tenacity")); #endif