diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-07-11 21:45:23 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-07-11 21:45:23 -0700 |
commit | 6d5a2ceefe7f842dd6872b6a38a355bc1b185fb3 (patch) | |
tree | a626073ef0620ec270662551d355a393aa0be38d /launcher/modplatform/flame | |
parent | 149bc8e9ce1be5edf93de4a4d63b93129ad321b8 (diff) | |
download | PrismLauncher-6d5a2ceefe7f842dd6872b6a38a355bc1b185fb3.tar.gz PrismLauncher-6d5a2ceefe7f842dd6872b6a38a355bc1b185fb3.tar.bz2 PrismLauncher-6d5a2ceefe7f842dd6872b6a38a355bc1b185fb3.zip |
fix(flameapi): getFile use shared_ptr
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/modplatform/flame')
-rw-r--r-- | launcher/modplatform/flame/FlameAPI.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/launcher/modplatform/flame/FlameAPI.cpp b/launcher/modplatform/flame/FlameAPI.cpp index 66eba4ff..485d6736 100644 --- a/launcher/modplatform/flame/FlameAPI.cpp +++ b/launcher/modplatform/flame/FlameAPI.cpp @@ -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; |