mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Use an owning QByteArray in ByteArraySink
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
parent
2b84053011
commit
316121ba8f
70 changed files with 397 additions and 390 deletions
|
|
@ -63,14 +63,17 @@ auto Download::makeCached(QUrl url, MetaEntryPtr entry, Options options) -> Down
|
|||
}
|
||||
#endif
|
||||
|
||||
auto Download::makeByteArray(QUrl url, QByteArray* output, Options options) -> Download::Ptr
|
||||
auto Download::makeByteArray(QUrl url, Options options) -> std::pair<Download::Ptr, QByteArray*>
|
||||
{
|
||||
auto dl = makeShared<Download>();
|
||||
dl->m_url = url;
|
||||
dl->setObjectName(QString("BYTES:") + url.toString());
|
||||
dl->m_options = options;
|
||||
dl->m_sink.reset(new ByteArraySink(output));
|
||||
return dl;
|
||||
|
||||
auto response = new QByteArray();
|
||||
dl->m_sink = std::make_unique<ByteArraySink>(std::unique_ptr<QByteArray>{ response });
|
||||
|
||||
return { dl, response };
|
||||
}
|
||||
|
||||
auto Download::makeFile(QUrl url, QString path, Options options) -> Download::Ptr
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue