summaryrefslogtreecommitdiffstats
path: root/logic/OneSixInstance.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-10-10 01:47:48 +0200
committerPetr Mrázek <peterix@gmail.com>2013-10-10 01:47:48 +0200
commit73f8bc5c92cb4a9b7ce507309001c6b206b5c8eb (patch)
treeda0b7c09fcd105a4144387e4261ad3aabc910862 /logic/OneSixInstance.cpp
parenteaf0cbeafc5ff70bd2bb0d66b5f5980a71f824c5 (diff)
downloadMultiMC-73f8bc5c92cb4a9b7ce507309001c6b206b5c8eb.tar
MultiMC-73f8bc5c92cb4a9b7ce507309001c6b206b5c8eb.tar.gz
MultiMC-73f8bc5c92cb4a9b7ce507309001c6b206b5c8eb.tar.lz
MultiMC-73f8bc5c92cb4a9b7ce507309001c6b206b5c8eb.tar.xz
MultiMC-73f8bc5c92cb4a9b7ce507309001c6b206b5c8eb.zip
Version changing removes any existing version json.
Diffstat (limited to 'logic/OneSixInstance.cpp')
-rw-r--r--logic/OneSixInstance.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp
index ad3f9f58..1b7b5bb4 100644
--- a/logic/OneSixInstance.cpp
+++ b/logic/OneSixInstance.cpp
@@ -192,6 +192,11 @@ bool OneSixInstance::setIntendedVersionId(QString version)
{
settings().set("IntendedVersion", version);
setShouldUpdate(true);
+ auto pathCustom = PathCombine(instanceRoot(), "custom.json");
+ auto pathOrig = PathCombine(instanceRoot(), "version.json");
+ QFile::remove(pathCustom);
+ QFile::remove(pathOrig);
+ reloadFullVersion();
return true;
}
@@ -271,7 +276,11 @@ bool OneSixInstance::reloadFullVersion()
d->version = version;
return true;
}
- return false;
+ else
+ {
+ d->version.reset();
+ return false;
+ }
}
std::shared_ptr<OneSixVersion> OneSixInstance::getFullVersion()