Skip to content

Commit

Permalink
fix(flameapi): getFile use shared_ptr
Browse files Browse the repository at this point in the history
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
  • Loading branch information
Ryex committed Jul 12, 2023
1 parent 149bc8e commit 6d5a2ce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions launcher/modplatform/flame/FlameAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,12 @@ Task::Ptr FlameAPI::getFiles(const QStringList& fileIds, std::shared_ptr<QByteAr
return netJob;
}

Task::Ptr FlameAPI::getFile(const QString& addonId, const QString& fileId, QByteArray* response) const
Task::Ptr FlameAPI::getFile(const QString& addonId, const QString& fileId, std::shared_ptr<QByteArray>response) const
{
auto netJob = makeShared<NetJob>(QString("Flame::GetFile"), APPLICATION->network());
netJob->addNetAction(
Net::Download::makeByteArray(QUrl(QString("https://api.curseforge.com/v1/mods/%1/files/%2").arg(addonId, fileId)), response));

QObject::connect(netJob.get(), &NetJob::finished, [response] { delete response; });
QObject::connect(netJob.get(), &NetJob::failed, [addonId, fileId] { qDebug() << "Flame API file failure" << addonId << fileId; });

return netJob;
Expand Down

0 comments on commit 6d5a2ce

Please sign in to comment.