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

@ -167,14 +167,14 @@ void FlamePackExportTask::makeApiRequest()
setStatus(tr("Finding versions for hashes..."));
setProgress(2, 5);
auto response = std::make_shared<QByteArray>();
QList<uint> fingerprints;
for (auto& murmur : pendingHashes.keys()) {
fingerprints.push_back(murmur.toUInt());
}
task.reset(api.matchFingerprints(fingerprints, response.get()));
auto [matchTask, response] = api.matchFingerprints(fingerprints);
task = matchTask;
connect(task.get(), &Task::succeeded, this, [this, response] {
QJsonParseError parseError{};
@ -245,16 +245,16 @@ void FlamePackExportTask::getProjectsInfo()
}
}
auto response = std::make_shared<QByteArray>();
Task::Ptr projTask;
QByteArray* response;
if (addonIds.isEmpty()) {
buildZip();
return;
} else if (addonIds.size() == 1) {
projTask = api.getProject(*addonIds.begin(), response.get());
std::tie(projTask, response) = api.getProject(*addonIds.begin());
} else {
projTask = api.getProjects(addonIds, response.get());
std::tie(projTask, response) = api.getProjects(addonIds);
}
connect(projTask.get(), &Task::succeeded, this, [this, response, addonIds] {