diff options
| author | Tannin <sherb@gmx.net> | 2016-02-09 20:05:41 +0100 |
|---|---|---|
| committer | Tannin <sherb@gmx.net> | 2016-02-09 20:05:41 +0100 |
| commit | 63eaf453e0de2087ce7d2a3c26edc7eac4bd1882 (patch) | |
| tree | 7785a5a2050c797b3cf766298a0e42078e9ebeed /src/instancemanager.cpp | |
| parent | 8a9a1680b0b2ba1505636ab17f498d8ce6e02c2d (diff) | |
portable setup is no longer offered if the directory isn't writable
Diffstat (limited to 'src/instancemanager.cpp')
| -rw-r--r-- | src/instancemanager.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/instancemanager.cpp b/src/instancemanager.cpp index 48c12d42..d48d02d2 100644 --- a/src/instancemanager.cpp +++ b/src/instancemanager.cpp @@ -172,18 +172,21 @@ QString InstanceManager::determineDataPath() QStringList instanceList = instances(); - qDebug("%d - %s", instanceList.size(), qPrintable(instanceList.join(";"))); - if (instanceList.size() == 0) { - switch (queryInstallMode()) { - case InstallationMode::PORTABLE: { - instanceId = QString(); - } break; - case InstallationMode::REGULAR: { - instanceId = queryInstanceName(); - } break; + if (QFileInfo(qApp->applicationDirPath()).isWritable()) { + switch (queryInstallMode()) { + case InstallationMode::PORTABLE: { + instanceId = QString(); + } break; + case InstallationMode::REGULAR: { + instanceId = queryInstanceName(); + } break; + } + } else { + instanceId = queryInstanceName(); } } else { + // don't offer portable instance if we can't set one up. instanceId = chooseInstance(instanceList); } } |
