diff options
author | Stanislaw Halik <sthalik@tehran.lain.pl> | 2019-10-30 05:40:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-30 05:40:21 +0100 |
commit | ebf9de109b86336b8844fc6fd15a34760481de5e (patch) | |
tree | 2543e9a2e5f3ca5133141e11b2962c26fdaf3951 /options | |
parent | 2716d8e2ae7df7fb99d9d64d1efaa554d1d38034 (diff) | |
parent | 29591277d9cae18895ef03cb858b2b327813830e (diff) |
Merge pull request #996 from opentrack/pr/proton-wine-proto
add support for proton wine
Diffstat (limited to 'options')
-rw-r--r-- | options/globals.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/options/globals.cpp b/options/globals.cpp index 52e198db..099a7208 100644 --- a/options/globals.cpp +++ b/options/globals.cpp @@ -151,11 +151,20 @@ fail: constexpr const char* subdir = "ini"; } else { - const QString dir = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation).value(0, QString()); + QString dir = QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation).value(0, QString()); if (dir.isEmpty()) goto fail; +#if !defined _WIN32 && !defined __APPLE__ + const QString fmt = QStringLiteral("%1/%2"); + if (!QFile::exists(fmt.arg(dir, OPENTRACK_ORG))) + { + dir = QStandardPaths::standardLocations(QStandardPaths::ConfigLocation).value(0, QString()); + if (dir.isEmpty()) + goto fail; + } +#endif (void)QDir(dir).mkpath(OPENTRACK_ORG); - return QStringLiteral("%1/%2").arg(dir, OPENTRACK_ORG); + return fmt.arg(dir, OPENTRACK_ORG); } } |