diff options
author | flow <flowlnlnln@gmail.com> | 2023-01-26 10:15:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-26 10:15:28 -0800 |
commit | f705cf09bce828ea2f8bae918673c1d921713866 (patch) | |
tree | b41112786d7bb3bd10813034157c3c1373f3ae57 /launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp | |
parent | 9b7c8ea22d367f31ff9537fb69aa4dbc5f417668 (diff) | |
parent | 29f7ea752fd34bdea64a7c7f2c505982ac39ce0d (diff) | |
download | PrismLauncher-f705cf09bce828ea2f8bae918673c1d921713866.tar.gz PrismLauncher-f705cf09bce828ea2f8bae918673c1d921713866.tar.bz2 PrismLauncher-f705cf09bce828ea2f8bae918673c1d921713866.zip |
Merge pull request #787 from flowln/make_shared_ptrs_explicit
Diffstat (limited to 'launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp')
-rw-r--r-- | launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp index 80850b4c..346a00b0 100644 --- a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp +++ b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp @@ -127,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&" @@ -142,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); @@ -155,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(); |