fix(flameapi): getFile use shared_ptr
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
parent
149bc8e9ce
commit
6d5a2ceefe
@ -202,13 +202,12 @@ Task::Ptr FlameAPI::getFiles(const QStringList& fileIds, std::shared_ptr<QByteAr
|
|||||||
return netJob;
|
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());
|
auto netJob = makeShared<NetJob>(QString("Flame::GetFile"), APPLICATION->network());
|
||||||
netJob->addNetAction(
|
netJob->addNetAction(
|
||||||
Net::Download::makeByteArray(QUrl(QString("https://api.curseforge.com/v1/mods/%1/files/%2").arg(addonId, fileId)), response));
|
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; });
|
QObject::connect(netJob.get(), &NetJob::failed, [addonId, fileId] { qDebug() << "Flame API file failure" << addonId << fileId; });
|
||||||
|
|
||||||
return netJob;
|
return netJob;
|
||||||
|
Loading…
Reference in New Issue
Block a user