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>
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user