diff options
author | Petr Mrázek <peterix@users.noreply.github.com> | 2021-04-08 21:29:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-08 21:29:10 +0200 |
commit | 4ca481b2b34e711112eb7a257fc2385c0dce9dd2 (patch) | |
tree | 71de507b05d1a184031b4679fca25a288f87548a /application | |
parent | e5804b1279cd0588d9434f298675ccd89fe21fc8 (diff) | |
parent | 524fc5b6ecf9e5f193db1173164ae23c6e6702b1 (diff) | |
download | PrismLauncher-4ca481b2b34e711112eb7a257fc2385c0dce9dd2.tar.gz PrismLauncher-4ca481b2b34e711112eb7a257fc2385c0dce9dd2.tar.bz2 PrismLauncher-4ca481b2b34e711112eb7a257fc2385c0dce9dd2.zip |
Merge pull request #3715 from jamierocks/atl-trycatch-json
NOISSUE Fedora build, ATL exceptions, and language tweaks
Diffstat (limited to 'application')
-rw-r--r-- | application/CMakeLists.txt | 5 | ||||
-rw-r--r-- | application/KonamiCode.cpp | 2 | ||||
-rw-r--r-- | application/pages/modplatform/atlauncher/AtlListModel.cpp (renamed from application/pages/modplatform/atlauncher/AtlModel.cpp) | 13 | ||||
-rw-r--r-- | application/pages/modplatform/atlauncher/AtlListModel.h (renamed from application/pages/modplatform/atlauncher/AtlModel.h) | 0 | ||||
-rw-r--r-- | application/pages/modplatform/atlauncher/AtlPage.h | 2 |
5 files changed, 15 insertions, 7 deletions
diff --git a/application/CMakeLists.txt b/application/CMakeLists.txt index afd13574..fd49c267 100644 --- a/application/CMakeLists.txt +++ b/application/CMakeLists.txt @@ -125,13 +125,12 @@ SET(MULTIMC_SOURCES pages/modplatform/VanillaPage.cpp pages/modplatform/VanillaPage.h - pages/modplatform/atlauncher/AtlModel.cpp - pages/modplatform/atlauncher/AtlModel.h pages/modplatform/atlauncher/AtlFilterModel.cpp pages/modplatform/atlauncher/AtlFilterModel.h + pages/modplatform/atlauncher/AtlListModel.cpp + pages/modplatform/atlauncher/AtlListModel.h pages/modplatform/atlauncher/AtlPage.cpp pages/modplatform/atlauncher/AtlPage.h - pages/modplatform/atlauncher/AtlPage.h pages/modplatform/ftb/FtbFilterModel.cpp pages/modplatform/ftb/FtbFilterModel.h diff --git a/application/KonamiCode.cpp b/application/KonamiCode.cpp index 4c5af837..46a2a0b2 100644 --- a/application/KonamiCode.cpp +++ b/application/KonamiCode.cpp @@ -35,7 +35,7 @@ void KonamiCode::input(QEvent* event) { m_progress = 0; } - if(m_progress == konamiCode.size()) + if(m_progress == static_cast<int>(konamiCode.size())) { m_progress = 0; emit triggered(); diff --git a/application/pages/modplatform/atlauncher/AtlModel.cpp b/application/pages/modplatform/atlauncher/AtlListModel.cpp index 4b1b1c8e..f3be6198 100644 --- a/application/pages/modplatform/atlauncher/AtlModel.cpp +++ b/application/pages/modplatform/atlauncher/AtlListModel.cpp @@ -1,8 +1,9 @@ -#include "AtlModel.h" +#include "AtlListModel.h" #include <BuildConfig.h> #include <MultiMC.h> #include <Env.h> +#include <Json.h> namespace Atl { @@ -99,7 +100,15 @@ void ListModel::requestFinished() auto packObj = packRaw.toObject(); ATLauncher::IndexedPack pack; - ATLauncher::loadIndexedPack(pack, packObj); + + try { + ATLauncher::loadIndexedPack(pack, packObj); + } + catch (const JSONValidationError &e) { + qDebug() << QString::fromUtf8(response); + qWarning() << "Error while reading pack manifest from ATLauncher: " << e.cause(); + return; + } // ignore packs without a published version if(pack.versions.length() == 0) continue; diff --git a/application/pages/modplatform/atlauncher/AtlModel.h b/application/pages/modplatform/atlauncher/AtlListModel.h index 2d30a64e..2d30a64e 100644 --- a/application/pages/modplatform/atlauncher/AtlModel.h +++ b/application/pages/modplatform/atlauncher/AtlListModel.h diff --git a/application/pages/modplatform/atlauncher/AtlPage.h b/application/pages/modplatform/atlauncher/AtlPage.h index 368de666..715cf5f4 100644 --- a/application/pages/modplatform/atlauncher/AtlPage.h +++ b/application/pages/modplatform/atlauncher/AtlPage.h @@ -16,7 +16,7 @@ #pragma once #include "AtlFilterModel.h" -#include "AtlModel.h" +#include "AtlListModel.h" #include <QWidget> |