summaryrefslogtreecommitdiff
path: root/src/instancemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/instancemanager.cpp')
-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;