aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp')
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp
index e6704eef..346a00b0 100644
--- a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp
+++ b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp
@@ -40,7 +40,6 @@
#include "Json.h"
#include "minecraft/MinecraftInstance.h"
#include "minecraft/PackProfile.h"
-#include "ui/dialogs/ModDownloadDialog.h"
#include "ui/widgets/ProjectItem.h"
#include <QMessageBox>
@@ -128,7 +127,7 @@ bool ModpackListModel::setData(const QModelIndex &index, const QVariant &value,
void ModpackListModel::performPaginatedSearch()
{
// TODO: Move to standalone API
- NetJob* netJob = new NetJob("Modrinth::SearchModpack", APPLICATION->network());
+ auto netJob = makeShared<NetJob>("Modrinth::SearchModpack", APPLICATION->network());
auto searchAllUrl = QString(BuildConfig.MODRINTH_PROD_URL +
"/search?"
"offset=%1&"
@@ -143,7 +142,7 @@ void ModpackListModel::performPaginatedSearch()
netJob->addNetAction(Net::Download::makeByteArray(QUrl(searchAllUrl), &m_all_response));
- QObject::connect(netJob, &NetJob::succeeded, this, [this] {
+ QObject::connect(netJob.get(), &NetJob::succeeded, this, [this] {
QJsonParseError parse_error_all{};
QJsonDocument doc_all = QJsonDocument::fromJson(m_all_response, &parse_error_all);
@@ -156,7 +155,7 @@ void ModpackListModel::performPaginatedSearch()
searchRequestFinished(doc_all);
});
- QObject::connect(netJob, &NetJob::failed, this, &ModpackListModel::searchRequestFailed);
+ QObject::connect(netJob.get(), &NetJob::failed, this, &ModpackListModel::searchRequestFailed);
jobPtr = netJob;
jobPtr->start();