aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/modplatform/flame
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2023-01-24 16:52:09 -0300
committerflow <flowlnlnln@gmail.com>2023-01-25 16:57:51 -0300
commit29f7ea752fd34bdea64a7c7f2c505982ac39ce0d (patch)
treef3d76dd640ae4f6a241fb0ff4532d938dc1c33bd /launcher/ui/pages/modplatform/flame
parent5186ad95d3cd66da8c844d9c3c0cd95b8b2f0b94 (diff)
downloadPrismLauncher-29f7ea752fd34bdea64a7c7f2c505982ac39ce0d.tar.gz
PrismLauncher-29f7ea752fd34bdea64a7c7f2c505982ac39ce0d.tar.bz2
PrismLauncher-29f7ea752fd34bdea64a7c7f2c505982ac39ce0d.zip
refactor: make shared_qobject_ptr ctor explicit
This turns issues like creating two shared ptrs from a single raw ptr from popping up at runtime, instead making them a compile error. Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/ui/pages/modplatform/flame')
-rw-r--r--launcher/ui/pages/modplatform/flame/FlameModel.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/launcher/ui/pages/modplatform/flame/FlameModel.cpp b/launcher/ui/pages/modplatform/flame/FlameModel.cpp
index 127c3de5..5961ea02 100644
--- a/launcher/ui/pages/modplatform/flame/FlameModel.cpp
+++ b/launcher/ui/pages/modplatform/flame/FlameModel.cpp
@@ -155,7 +155,7 @@ void ListModel::fetchMore(const QModelIndex& parent)
void ListModel::performPaginatedSearch()
{
- NetJob* netJob = new NetJob("Flame::Search", APPLICATION->network());
+ auto netJob = makeShared<NetJob>("Flame::Search", APPLICATION->network());
auto searchUrl = QString(
"https://api.curseforge.com/v1/mods/search?"
"gameId=432&"
@@ -172,8 +172,8 @@ void ListModel::performPaginatedSearch()
netJob->addNetAction(Net::Download::makeByteArray(QUrl(searchUrl), &response));
jobPtr = netJob;
jobPtr->start();
- QObject::connect(netJob, &NetJob::succeeded, this, &ListModel::searchRequestFinished);
- QObject::connect(netJob, &NetJob::failed, this, &ListModel::searchRequestFailed);
+ QObject::connect(netJob.get(), &NetJob::succeeded, this, &ListModel::searchRequestFinished);
+ QObject::connect(netJob.get(), &NetJob::failed, this, &ListModel::searchRequestFailed);
}
void ListModel::searchWithTerm(const QString& term, int sort)