From f714adf6d2cc94f20ba37f2776d0d61e22267f0e Mon Sep 17 00:00:00 2001 From: flow Date: Mon, 7 Mar 2022 16:22:57 -0300 Subject: refactor: move NetJob away from ModModel to ModAPI This is done so that 1. ModAPI behaves more like an actual API instead of just a helper, and 2. Allows for more easily creating other mod providers that may or may not use network tasks (foreshadowing lol) --- launcher/ui/pages/modplatform/flame/FlameModModel.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'launcher/ui/pages/modplatform/flame/FlameModModel.cpp') diff --git a/launcher/ui/pages/modplatform/flame/FlameModModel.cpp b/launcher/ui/pages/modplatform/flame/FlameModModel.cpp index 283f9ce7..cff29a79 100644 --- a/launcher/ui/pages/modplatform/flame/FlameModModel.cpp +++ b/launcher/ui/pages/modplatform/flame/FlameModModel.cpp @@ -11,18 +11,10 @@ ListModel::ListModel(FlameModPage* parent) : ModPlatform::ListModel(parent) {} ListModel::~ListModel() {} -void FlameMod::ListModel::searchRequestFinished() +void FlameMod::ListModel::searchRequestFinished(QJsonDocument& doc) { jobPtr.reset(); - QJsonParseError parse_error; - QJsonDocument doc = QJsonDocument::fromJson(response, &parse_error); - if(parse_error.error != QJsonParseError::NoError) { - qWarning() << "Error while parsing JSON response from Flame at " << parse_error.offset << " reason: " << parse_error.errorString(); - qWarning() << response; - return; - } - QList newList; auto packs = doc.array(); for(auto packRaw : packs) { -- cgit