diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-03-03 01:23:10 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-03-03 01:23:10 +0100 |
commit | 29cdc9364b0153d04a211adf3eab86076174c0a1 (patch) | |
tree | 9bb741e8c2291a31f0d210303550fec08df2cdd8 /logic/OneSixInstance.cpp | |
parent | 28ad9befdcac246eb69a434be970abc29a80bc80 (diff) | |
download | MultiMC-29cdc9364b0153d04a211adf3eab86076174c0a1.tar MultiMC-29cdc9364b0153d04a211adf3eab86076174c0a1.tar.gz MultiMC-29cdc9364b0153d04a211adf3eab86076174c0a1.tar.lz MultiMC-29cdc9364b0153d04a211adf3eab86076174c0a1.tar.xz MultiMC-29cdc9364b0153d04a211adf3eab86076174c0a1.zip |
More code butchery related to version files. No end in sight.
Diffstat (limited to 'logic/OneSixInstance.cpp')
-rw-r--r-- | logic/OneSixInstance.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/logic/OneSixInstance.cpp b/logic/OneSixInstance.cpp index 0e0be4d8..f6fe49f1 100644 --- a/logic/OneSixInstance.cpp +++ b/logic/OneSixInstance.cpp @@ -27,6 +27,7 @@ #include "icons/IconList.h" #include "MinecraftProcess.h" #include "gui/dialogs/OneSixModEditDialog.h" +#include <MMCError.h> OneSixInstance::OneSixInstance(const QString &rootDir, SettingsObject *settings, QObject *parent) : BaseInstance(new OneSixInstancePrivate(), rootDir, settings, parent) @@ -320,21 +321,23 @@ bool OneSixInstance::reloadVersion() { I_D(OneSixInstance); - bool ret = d->version->reload(false, externalPatches()); - if (ret) - { - ret = d->vanillaVersion->reload(true, externalPatches()); - } - if (ret) + try { + d->version->reload(false, externalPatches()); + d->vanillaVersion->reload(true, externalPatches()); setFlags(flags() & ~VersionBrokenFlag); emit versionReloaded(); + return true; } - else + catch(MMCError error) { + d->version->clear(); + d->vanillaVersion->clear(); setFlags(flags() | VersionBrokenFlag); + //TODO: rethrow to show some error message(s)? + emit versionReloaded(); + return false; } - return ret; } void OneSixInstance::clearVersion() |