UPD: Store cache in the program directory in portable mode

This commit is contained in:
Alexander Koblov 2024-03-29 21:01:30 +03:00
commit 070a667cc9

View file

@ -10,6 +10,7 @@ var
gpLngDir : String = ''; // path to language *.po files
gpPixmapPath : String = ''; // path to pixmaps
gpHighPath : String = ''; // editor highlighter directory
gpCacheDir : String = ''; // cache directory
gpThumbCacheDir : String = ''; // thumbnails cache directory
//Global Configuration Filename
@ -60,6 +61,11 @@ begin
gpCfgDir := gpGlobalCfgDir;
end;
end;
if gpCfgDir <> gpGlobalCfgDir then
gpCacheDir := GetAppCacheDir
else begin
gpCacheDir := gpExePath + 'cache';
end;
DCDebug('Executable directory: ', gpExePath);
DCDebug('Configuration directory: ', gpCfgDir);
DCDebug('Global configuration directory: ', gpGlobalCfgDir);
@ -68,7 +74,7 @@ begin
gpLngDir := gpExePath + 'language' + DirectorySeparator;
gpPixmapPath := gpExePath + 'pixmaps' + DirectorySeparator;
gpHighPath:= gpExePath + 'highlighters' + DirectorySeparator;
gpThumbCacheDir := GetAppCacheDir + PathDelim + 'thumbnails';
gpThumbCacheDir := gpCacheDir + PathDelim + 'thumbnails';
// set up environment variables
UpdateEnvironmentVariable;