Browse Source

FileNames: Support XDG paths handling under wxGTK 3.0

Signed-off-by: Mart Raudsepp <leio@gentoo.org>
pull/300/head
Mart Raudsepp 10 months ago
parent
commit
663dfa4671
  1. 2
      src/AudacityApp.cpp
  2. 6
      src/FileNames.cpp

2
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

6
src/FileNames.cpp

@ -47,6 +47,10 @@ used throughout Audacity into this one place.
#include <windows.h>
#endif
#if defined(__WXGTK__) && !wxCHECK_VERSION(3, 1, 1)
#include <glib.h>
#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

Loading…
Cancel
Save