From c425d3e20de4496c5e543664b67f7ea158d5978b Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Wed, 8 Jul 2009 00:27:05 +0000 Subject: [PATCH] OSX: Config files now in a subdirectory of ~/Library/Preferences. This will keep your settings when you install new versions. Patch by MagerValp, issue 192 git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@907 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- setup.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/setup.c b/setup.c index 054b97af..ba0245bd 100644 --- a/setup.c +++ b/setup.c @@ -110,12 +110,8 @@ void Set_data_directory(const char * program_dir, char * data_dir) // OUT: Write into config_dir. Trailing / or \ is kept. void Set_config_directory(const char * program_dir, char * config_dir) { - // MacOSX - #if defined(__macosx__) - strcpy(config_dir,program_dir); - strcat(config_dir,"Contents/Resources/"); // AmigaOS4 - #elif defined(__amigaos4__) || defined(__AROS__) + #if defined(__amigaos4__) || defined(__AROS__) strcpy(config_dir,"PROGDIR:"); // GP2X #elif defined(__GP2X__) @@ -141,6 +137,10 @@ void Set_config_directory(const char * program_dir, char * config_dir) // "~/.grafx2", the BeOS way const char* Config_SubDir = ".grafx2"; config_parent_dir = getenv("$HOME"); + #elif defined(__macosx__) + // "~/Library/Preferences/com.googlecode.grafx2" + const char* Config_SubDir = "Library/Preferences/com.googlecode.grafx2"; + config_parent_dir = getenv("HOME"); #else // "~/.grafx2" const char* Config_SubDir = ".grafx2";