summaryrefslogtreecommitdiffstats
path: root/logic
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-05-28 09:36:58 +0200
committerPetr Mrázek <peterix@gmail.com>2015-05-28 09:36:58 +0200
commita98e1df10cef774672e919497c43373e86c77f97 (patch)
treec29b1c33fff9a4ee4281a8ca7f0c1755dbb76bcc /logic
parentf9e186ab704401416832d723c2e70a0f7a7435b3 (diff)
downloadMultiMC-a98e1df10cef774672e919497c43373e86c77f97.tar
MultiMC-a98e1df10cef774672e919497c43373e86c77f97.tar.gz
MultiMC-a98e1df10cef774672e919497c43373e86c77f97.tar.lz
MultiMC-a98e1df10cef774672e919497c43373e86c77f97.tar.xz
MultiMC-a98e1df10cef774672e919497c43373e86c77f97.zip
GH-1011 fetch missing versions when customizing/reverting Minecraft patches
Diffstat (limited to 'logic')
-rw-r--r--logic/minecraft/MinecraftVersionList.cpp1
-rw-r--r--logic/minecraft/OneSixProfileStrategy.cpp22
2 files changed, 12 insertions, 11 deletions
diff --git a/logic/minecraft/MinecraftVersionList.cpp b/logic/minecraft/MinecraftVersionList.cpp
index 90ef5ebe..c20534e9 100644
--- a/logic/minecraft/MinecraftVersionList.cpp
+++ b/logic/minecraft/MinecraftVersionList.cpp
@@ -599,6 +599,7 @@ void MinecraftVersionList::saveCachedList()
QJsonObject entryObj;
entryObj.insert("id", mcversion->descriptor());
+ entryObj.insert("version", mcversion->descriptor());
entryObj.insert("time", mcversion->m_updateTimeString);
entryObj.insert("releaseTime", mcversion->m_releaseTimeString);
entryObj.insert("type", mcversion->m_type);
diff --git a/logic/minecraft/OneSixProfileStrategy.cpp b/logic/minecraft/OneSixProfileStrategy.cpp
index b7ba2bf6..cd8fd976 100644
--- a/logic/minecraft/OneSixProfileStrategy.cpp
+++ b/logic/minecraft/OneSixProfileStrategy.cpp
@@ -275,19 +275,19 @@ bool OneSixProfileStrategy::customizePatch(ProfilePatchPtr patch)
{
return false;
}
- QSaveFile jsonFile(filename);
- if(!jsonFile.open(QIODevice::WriteOnly))
- {
- return false;
- }
- auto document = patch->toJson(true);
- jsonFile.write(document.toJson());
- if(!jsonFile.commit())
- {
- return false;
- }
try
{
+ QSaveFile jsonFile(filename);
+ if(!jsonFile.open(QIODevice::WriteOnly))
+ {
+ return false;
+ }
+ auto document = patch->toJson(true);
+ jsonFile.write(document.toJson());
+ if(!jsonFile.commit())
+ {
+ return false;
+ }
load();
}
catch (VersionIncomplete &error)