From 96ee33aa5f086f3230db1a4de278b392c0c04ae8 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 23 Dec 2014 23:04:38 +0100 Subject: fix and cleanup c404ef98 (windows config dir) --- libs/ardour/filesystem_paths.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'libs/ardour') diff --git a/libs/ardour/filesystem_paths.cc b/libs/ardour/filesystem_paths.cc index 00ec2790f2..37104b01a1 100644 --- a/libs/ardour/filesystem_paths.cc +++ b/libs/ardour/filesystem_paths.cc @@ -49,19 +49,20 @@ user_config_directory () if (!p.empty()) return p; #ifdef __APPLE__ + p = Glib::build_filename (Glib::get_home_dir(), "Library/Preferences"); -#else - const char* c = 0; - /* adopt freedesktop standards, and put .ardour3 into $XDG_CONFIG_HOME or ~/.config - */ +#else + const char* c = 0; + /* adopt freedesktop standards, and put .ardour3 into $XDG_CONFIG_HOME or ~/.config */ if ((c = getenv ("XDG_CONFIG_HOME")) != 0) { p = c; } else { + #ifdef PLATFORM_WINDOWS // Not technically the home dir (since it needs to be a writable folder) - const string home_dir = Glib::build_filename (Glib::get_user_config_dir(), user_config_dir_name); + const string home_dir = Glib::get_user_config_dir(); #else const string home_dir = Glib::get_home_dir(); #endif @@ -69,17 +70,16 @@ user_config_directory () error << "Unable to determine home directory" << endmsg; exit (1); } + p = home_dir; #ifndef PLATFORM_WINDOWS - p = home_dir; p = Glib::build_filename (p, ".config"); #endif + } -#endif +#endif // end not __APPLE__ -#ifndef PLATFORM_WINDOWS p = Glib::build_filename (p, user_config_dir_name); -#endif if (!Glib::file_test (p, Glib::FILE_TEST_EXISTS)) { if (g_mkdir_with_parents (p.c_str(), 0755)) { -- cgit v1.2.3