More code butchery related to version files. No end in sight.

This commit is contained in:
Petr Mrázek 2014-03-03 01:23:10 +01:00
parent 28ad9befdc
commit 29cdc9364b
6 changed files with 109 additions and 122 deletions

View file

@ -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()