portable setup is no longer offered if the directory isn't writable

This commit is contained in:
Tannin
2016-02-09 20:05:41 +01:00
parent 8a9a1680b0
commit 63eaf453e0
3 changed files with 14 additions and 12 deletions
+12 -9
View File
@@ -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);
}
}