summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTannin <sherb@gmx.net>2016-05-19 19:15:19 +0200
committerTannin <sherb@gmx.net>2016-05-19 19:15:19 +0200
commit45a182a381a197b2e62eaf9f87ad15f84250c1e7 (patch)
tree3682404aa946da4140a98ea0ea93ccdb50e63964 /src
parent0b07cfa3f02d8d48bbb753539ed54f7bec884ae8 (diff)
bugfix: initial setup didn't offer a portable install even if the global install dir is gone
Diffstat (limited to 'src')
-rw-r--r--src/instancemanager.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/instancemanager.cpp b/src/instancemanager.cpp
index d48d02d2..c74f3c1a 100644
--- a/src/instancemanager.cpp
+++ b/src/instancemanager.cpp
@@ -166,8 +166,11 @@ void InstanceManager::createDataPath(const QString &dataPath) const
QString InstanceManager::determineDataPath()
{
QString instanceId = currentInstance();
+ QString dataPath = QDir::fromNativeSeparators(
+ QStandardPaths::writableLocation(QStandardPaths::DataLocation)
+ + "/" + instanceId);
- if (instanceId.isEmpty() && !portableInstall()) {
+ if ((instanceId.isEmpty() || !QFileInfo::exists(dataPath)) && !portableInstall()) {
// no portable install and no selected instance
QStringList instanceList = instances();
@@ -191,16 +194,11 @@ QString InstanceManager::determineDataPath()
}
}
- if (instanceId.isEmpty()) {
- qDebug("portable mode");
+ if (instanceId.isEmpty() || !QFileInfo::exists(dataPath)) {
return qApp->applicationDirPath();
} else {
setCurrentInstance(instanceId);
- QString dataPath = QDir::fromNativeSeparators(
- QStandardPaths::writableLocation(QStandardPaths::DataLocation)
- + "/" + instanceId);
-
createDataPath(dataPath);
return dataPath;