mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-02 19:46:06 -04:00
Use QDesktopServices::storageLocation() on Mac OS too.
This commit is contained in:
parent
842eb22e1e
commit
e323fd169e
1 changed files with 2 additions and 6 deletions
|
@ -37,6 +37,7 @@ Config::Config()
|
||||||
QString homePath = QDir::homePath();
|
QString homePath = QDir::homePath();
|
||||||
|
|
||||||
#if defined(Q_WS_X11)
|
#if defined(Q_WS_X11)
|
||||||
|
// we can't use QDesktopServices on X11 as it uses XDG_DATA_HOME instead of XDG_CONFIG_HOME
|
||||||
QByteArray env = qgetenv("XDG_CONFIG_HOME");
|
QByteArray env = qgetenv("XDG_CONFIG_HOME");
|
||||||
if (env.isEmpty()) {
|
if (env.isEmpty()) {
|
||||||
userPath = homePath;
|
userPath = homePath;
|
||||||
|
@ -52,12 +53,7 @@ Config::Config()
|
||||||
}
|
}
|
||||||
|
|
||||||
userPath += "/keepassx/";
|
userPath += "/keepassx/";
|
||||||
#elif defined(Q_WS_MAC)
|
#else
|
||||||
// TODO: where to store the config on mac?
|
|
||||||
userPath = homePath;
|
|
||||||
userPath += "/.keepassx/";
|
|
||||||
#elif defined(Q_WS_WIN)
|
|
||||||
// we can't use QDesktopServices on X11 as it uses XDG_DATA_HOME instead of XDG_CONFIG_HOME
|
|
||||||
userPath = QDir::fromNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::DataLocation));
|
userPath = QDir::fromNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::DataLocation));
|
||||||
userPath += "/keepassx/";
|
userPath += "/keepassx/";
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue