aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp
diff options
context:
space:
mode:
authorflow <thiagodonato300@gmail.com>2022-03-07 16:22:57 -0300
committerflow <thiagodonato300@gmail.com>2022-03-07 16:22:57 -0300
commitf714adf6d2cc94f20ba37f2776d0d61e22267f0e (patch)
treea72a3f07b0edc45e8c07f97daa8b2786d7cf3ad3 /launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp
parent39bd04f06ff42623f7349096d707c4a877fc7cd7 (diff)
downloadPrismLauncher-f714adf6d2cc94f20ba37f2776d0d61e22267f0e.tar.gz
PrismLauncher-f714adf6d2cc94f20ba37f2776d0d61e22267f0e.tar.bz2
PrismLauncher-f714adf6d2cc94f20ba37f2776d0d61e22267f0e.zip
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)
Diffstat (limited to 'launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp')
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp
index dc3d1469..784b1128 100644
--- a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp
+++ b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp
@@ -10,19 +10,10 @@ ListModel::ListModel(ModrinthPage* parent) : ModPlatform::ListModel(parent) {}
ListModel::~ListModel() {}
-void Modrinth::ListModel::searchRequestFinished()
+void Modrinth::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 Modrinth at " << parse_error.offset
- << " reason: " << parse_error.errorString();
- qWarning() << response;
- return;
- }
-
+
QList<ModPlatform::IndexedPack> newList;
auto packs = doc.object().value("hits").toArray();
for (auto packRaw : packs) {