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/VersionFinal.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/VersionFinal.cpp')
-rw-r--r-- | logic/VersionFinal.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/logic/VersionFinal.cpp b/logic/VersionFinal.cpp index 3aa95ed7..ec450eda 100644 --- a/logic/VersionFinal.cpp +++ b/logic/VersionFinal.cpp @@ -28,10 +28,10 @@ VersionFinal::VersionFinal(OneSixInstance *instance, QObject *parent) bool VersionFinal::reload(const bool onlyVanilla, const QStringList &external) { + //FIXME: source of epic failure. beginResetModel(); - bool ret = OneSixVersionBuilder::build(this, m_instance, onlyVanilla, external); + OneSixVersionBuilder::build(this, m_instance, onlyVanilla, external); endResetModel(); - return ret; } void VersionFinal::clear() @@ -128,11 +128,15 @@ QList<std::shared_ptr<OneSixLibrary> > VersionFinal::getActiveNativeLibs() std::shared_ptr<VersionFinal> VersionFinal::fromJson(const QJsonObject &obj) { std::shared_ptr<VersionFinal> version(new VersionFinal(0)); - if (OneSixVersionBuilder::readJsonAndApplyToVersion(version.get(), obj)) + try { - return version; + OneSixVersionBuilder::readJsonAndApplyToVersion(version.get(), obj); } - return 0; + catch(MMCError err) + { + return 0; + } + return version; } QVariant VersionFinal::data(const QModelIndex &index, int role) const |