mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-18 16:17:03 +00:00
GODT-2020: fix xdg_{home,cache}_home variables
This commit is contained in:
committed by
Romain LE JEUNE
parent
cb871ce4bc
commit
9548f984eb
@ -84,11 +84,12 @@ QString userConfigDir()
|
|||||||
dir += "/Library/Application Support";
|
dir += "/Library/Application Support";
|
||||||
#else
|
#else
|
||||||
dir = qgetenv ("XDG_CONFIG_HOME");
|
dir = qgetenv ("XDG_CONFIG_HOME");
|
||||||
if (dir.isEmpty())
|
if (dir.isEmpty()) {
|
||||||
dir = qgetenv ("HOME");
|
dir = qgetenv ("HOME");
|
||||||
if (dir.isEmpty())
|
if (dir.isEmpty())
|
||||||
throw Exception("neither $XDG_CONFIG_HOME nor $HOME are defined");
|
throw Exception("neither $XDG_CONFIG_HOME nor $HOME are defined");
|
||||||
dir += "/.config";
|
dir += "/.config";
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
QString const folder = QDir(dir).absoluteFilePath(configFolder);
|
QString const folder = QDir(dir).absoluteFilePath(configFolder);
|
||||||
QDir().mkpath(folder);
|
QDir().mkpath(folder);
|
||||||
@ -115,11 +116,12 @@ QString userCacheDir()
|
|||||||
dir += "/Library/Caches";
|
dir += "/Library/Caches";
|
||||||
#else
|
#else
|
||||||
dir = qgetenv ("XDG_CACHE_HOME");
|
dir = qgetenv ("XDG_CACHE_HOME");
|
||||||
if (dir.isEmpty())
|
if (dir.isEmpty()) {
|
||||||
dir = qgetenv ("HOME");
|
dir = qgetenv ("HOME");
|
||||||
if (dir.isEmpty())
|
if (dir.isEmpty())
|
||||||
throw Exception("neither XDG_CACHE_HOME nor $HOME are defined");
|
throw Exception("neither XDG_CACHE_HOME nor $HOME are defined");
|
||||||
dir += "/.cache";
|
dir += "/.cache";
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QString const folder = QDir(dir).absoluteFilePath(configFolder);
|
QString const folder = QDir(dir).absoluteFilePath(configFolder);
|
||||||
|
|||||||
Reference in New Issue
Block a user