From 55a0d110b654a93ef1bb9ee50a6f02ecaec7f88d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Tue, 13 May 2014 23:57:34 +0200 Subject: Lock down the version cache. Just enough to make it annoying to corrupt the files. --- logic/OneSixInstance.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'logic/OneSixInstance.cpp') diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp index 574dfc69..fc53bd39 100644 --- a/logic/OneSixInstance.cpp +++ b/logic/OneSixInstance.cpp @@ -24,6 +24,7 @@ #include "logic/OneSixInstance_p.h" #include "logic/OneSixUpdate.h" #include "logic/minecraft/VersionFinal.h" +#include "minecraft/VersionBuildError.h" #include "logic/assets/AssetsUtils.h" #include "icons/IconList.h" @@ -42,21 +43,13 @@ OneSixInstance::OneSixInstance(const QString &rootDir, SettingsObject *settings, void OneSixInstance::init() { - // FIXME: why is this decided here? what does this even mean? - if (QDir(instanceRoot()).exists("version.json")) + try { - try - { - reloadVersion(); - } - catch (MMCError &e) - { - // QLOG_ERROR() << "Caught exception on instance init: " << e.cause(); - } + reloadVersion(); } - else + catch (MMCError &e) { - clearVersion(); + QLOG_ERROR() << "Caught exception on instance init: " << e.cause(); } } @@ -388,6 +381,10 @@ void OneSixInstance::reloadVersion() d->version->reload(externalPatches()); d->m_flags.remove(VersionBrokenFlag); emit versionReloaded(); + } + catch (VersionIncomplete & error) + { + } catch (MMCError &error) { -- cgit v1.2.3