Use an owning QByteArray in ByteArraySink

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
(cherry picked from commit 316121ba8f)
This commit is contained in:
TheKodeToad 2026-02-17 22:01:59 +00:00 committed by Trial97
parent d4e5c0f95b
commit 4e4990bf8d
No known key found for this signature in database
GPG key ID: 55EF5DA53DB36318
66 changed files with 367 additions and 365 deletions

View file

@ -88,7 +88,6 @@ void ModrinthCheckUpdate::getUpdateModsForLoader(std::optional<ModPlatform::ModL
setStatus(tr("Waiting for the API response from Modrinth..."));
setProgress(m_progress + 1, m_progressTotal);
auto response = std::make_shared<QByteArray>();
QStringList hashes;
if (forceModLoaderCheck && loader.has_value()) {
for (auto hash : m_mappings.keys()) {
@ -105,9 +104,9 @@ void ModrinthCheckUpdate::getUpdateModsForLoader(std::optional<ModPlatform::ModL
return;
}
auto job = api.latestVersions(hashes, m_hashType, m_gameVersions, loader, response.get());
auto [job, response] = api.latestVersions(hashes, m_hashType, m_gameVersions, loader);
connect(job.get(), &Task::succeeded, this, [this, response, loader] { checkVersionsResponse(response.get(), loader); });
connect(job.get(), &Task::succeeded, this, [this, response, loader] { checkVersionsResponse(response, loader); });
connect(job.get(), &Task::failed, this, &ModrinthCheckUpdate::checkNextLoader);