From aaaccfa4519775d8be47f5171d70f1ae05fba076 Mon Sep 17 00:00:00 2001 From: natureh Date: Fri, 2 Sep 2011 14:57:36 +0200 Subject: [PATCH] Solving issue 681 completly : RT now search for an OS environment variable "RT_CACHE" first, in order to set the cache folder path (no "RawTherapeeXXX" subdirectory will be created). This variable is fully optional. --- rtgui/options.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/rtgui/options.cc b/rtgui/options.cc index 6598f6fb4..ef39b43a3 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -640,13 +640,18 @@ void Options::load () { printf("SHGetSpecialFolderPathW: Fail!\n"); }*/ - dataPath = g_getenv("LOCALAPPDATA"); + dataPath = g_getenv("RT_CACHE"); if (dataPath != NULL) - rtdir = Glib::ustring(dataPath) + Glib::ustring("\\") + Glib::ustring(CACHEFOLDERNAME); + rtdir = Glib::ustring(dataPath); else { - dataPath = g_getenv("USERPROFILE"); + dataPath = g_getenv("LOCALAPPDATA"); if (dataPath != NULL) - rtdir = Glib::ustring(dataPath) + Glib::ustring("\\Local Settings\\Application Data\\") + Glib::ustring(CACHEFOLDERNAME); + rtdir = Glib::ustring(dataPath) + Glib::ustring("\\") + Glib::ustring(CACHEFOLDERNAME); + else { + dataPath = g_getenv("USERPROFILE"); + if (dataPath != NULL) + rtdir = Glib::ustring(dataPath) + Glib::ustring("\\Local Settings\\Application Data\\") + Glib::ustring(CACHEFOLDERNAME); + } } #else rtdir = Glib::ustring(g_get_user_config_dir ()) + Glib::ustring("/") + Glib::ustring(CACHEFOLDERNAME);