mac:also build cache dir in options.cc

This commit is contained in:
Richard Barber
2020-02-16 22:53:56 -08:00
parent 12ea3db9cb
commit 0770363c6f

View File

@@ -2274,12 +2274,14 @@ void Options::load(bool lightweight)
const gchar* homedir; const gchar* homedir;
const gchar* configdir; const gchar* configdir;
homedir = g_getenv("HOME"); homedir = g_getenv("HOME");
configdir = "Library/Application Support/RawTherapee/config"; std::cout << "homedir=" << homedir << "\n";
configdir = "/../../../Application Support/RawTherapee/config";
int bufferSize = strlen(homedir) + strlen(configdir) + 1; int bufferSize = strlen(homedir) + strlen(configdir) + 1;
gchar* concatString = new gchar[ bufferSize ]; gchar* concatString = new gchar[ bufferSize ];
strcpy( concatString, homedir ); strcpy( concatString, homedir );
strcat( concatString, configdir ); strcat( concatString, configdir );
path = concatString; path = concatString;
std::cout << concatString << "\n";
delete[] concatString; delete[] concatString;
#else #else
path = g_getenv("RT_SETTINGS"); path = g_getenv("RT_SETTINGS");
@@ -2326,7 +2328,22 @@ void Options::load(bool lightweight)
} }
// Modify the path of the cache folder to the one provided in RT_CACHE environment variable // Modify the path of the cache folder to the one provided in RT_CACHE environment variable
#ifdef __APPLE__
const gchar* homedir;
const gchar* cachedir;
homedir = g_getenv("HOME"); // This returns the current container
std::cout << "homedir=" << homedir << "\n";
configdir = "/../../../Application Support/RawTherapee/cache";
int bufferSize = strlen(homedir) + strlen(cachedir) + 1;
gchar* concatString = new gchar[ bufferSize ];
strcpy( concatString, homedir );
strcat( concatString, cachedir );
std::cout << path << "\n";
path = concatString;
delete[] concatString;
#else
path = g_getenv("RT_CACHE"); path = g_getenv("RT_CACHE");
#endif
if (path != nullptr) { if (path != nullptr) {
cacheBaseDir = Glib::ustring(path); cacheBaseDir = Glib::ustring(path);