From b7d8e512f4184a755809fe9a964a04921f8abf7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Fri, 18 Mar 2016 15:02:54 +0100 Subject: NOISSUE Use patch problems and problem levels instead of exceptions for minecraft profiles. --- logic/minecraft/onesix/OneSixInstance.cpp | 20 +++++++------------- logic/minecraft/onesix/OneSixProfileStrategy.cpp | 2 +- logic/minecraft/onesix/OneSixUpdate.cpp | 15 +++------------ 3 files changed, 11 insertions(+), 26 deletions(-) (limited to 'logic/minecraft/onesix') diff --git a/logic/minecraft/onesix/OneSixInstance.cpp b/logic/minecraft/onesix/OneSixInstance.cpp index 3e83ff1c..f8b274ff 100644 --- a/logic/minecraft/onesix/OneSixInstance.cpp +++ b/logic/minecraft/onesix/OneSixInstance.cpp @@ -463,23 +463,17 @@ QString OneSixInstance::currentVersionId() const void OneSixInstance::reloadProfile() { - try - { - m_profile->reload(); - unsetFlag(VersionBrokenFlag); - emit versionReloaded(); - } - catch (VersionIncomplete &error) + m_profile->reload(); + auto severity = m_profile->getProblemSeverity(); + if(severity == ProblemSeverity::PROBLEM_ERROR) { + setFlag(VersionBrokenFlag); } - catch (Exception &error) + else { - m_profile->clear(); - setFlag(VersionBrokenFlag); - // TODO: rethrow to show some error message(s)? - emit versionReloaded(); - throw; + unsetFlag(VersionBrokenFlag); } + emit versionReloaded(); } void OneSixInstance::clearProfile() diff --git a/logic/minecraft/onesix/OneSixProfileStrategy.cpp b/logic/minecraft/onesix/OneSixProfileStrategy.cpp index baec635e..3ae055c0 100644 --- a/logic/minecraft/onesix/OneSixProfileStrategy.cpp +++ b/logic/minecraft/onesix/OneSixProfileStrategy.cpp @@ -407,7 +407,7 @@ bool OneSixProfileStrategy::installJarMods(QStringList filepaths) profile->appendPatch(f); } profile->saveCurrentOrder(); - profile->reapplySafe(); + profile->reapplyPatches(); return true; } diff --git a/logic/minecraft/onesix/OneSixUpdate.cpp b/logic/minecraft/onesix/OneSixUpdate.cpp index 814cde18..b49f09b6 100644 --- a/logic/minecraft/onesix/OneSixUpdate.cpp +++ b/logic/minecraft/onesix/OneSixUpdate.cpp @@ -174,19 +174,10 @@ void OneSixUpdate::jarlibStart() setStatus(tr("Getting the library files from Mojang...")); qDebug() << m_inst->name() << ": downloading libraries"; OneSixInstance *inst = (OneSixInstance *)m_inst; - try + inst->reloadProfile(); + if(inst->flags() & BaseInstance::VersionBrokenFlag) { - inst->reloadProfile(); - } - catch (Exception &e) - { - emitFailed(e.cause()); - return; - } - catch (...) - { - emitFailed(tr("Failed to load the version description file for reasons unknown.")); - return; + emitFailed(tr("Failed to load the version description files - check the instance for errors.")); } // Build a list of URLs that will need to be downloaded. -- cgit v1.2.3