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.

This commit is contained in:
natureh
2011-09-02 14:57:36 +02:00
parent 62db8ad43a
commit aaaccfa451

View File

@@ -640,13 +640,18 @@ void Options::load () {
printf("SHGetSpecialFolderPathW: Fail!\n"); printf("SHGetSpecialFolderPathW: Fail!\n");
}*/ }*/
dataPath = g_getenv("LOCALAPPDATA"); dataPath = g_getenv("RT_CACHE");
if (dataPath != NULL) if (dataPath != NULL)
rtdir = Glib::ustring(dataPath) + Glib::ustring("\\") + Glib::ustring(CACHEFOLDERNAME); rtdir = Glib::ustring(dataPath);
else { else {
dataPath = g_getenv("USERPROFILE"); dataPath = g_getenv("LOCALAPPDATA");
if (dataPath != NULL) 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 #else
rtdir = Glib::ustring(g_get_user_config_dir ()) + Glib::ustring("/") + Glib::ustring(CACHEFOLDERNAME); rtdir = Glib::ustring(g_get_user_config_dir ()) + Glib::ustring("/") + Glib::ustring(CACHEFOLDERNAME);