mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-03 03:46:58 +03:00
NOISSUE refactor *Download into more, smaller pieces
* Download is now Download. * Download uses Sink subclasses to process various events. * Validators can be used to further customize the Sink behaviour.
This commit is contained in:
parent
a750f6e63c
commit
a1abbd9e05
51 changed files with 824 additions and 765 deletions
|
|
@ -146,8 +146,7 @@ void LLListLoadTask::executeTask()
|
|||
// verify by poking the server.
|
||||
liteloaderEntry->setStale(true);
|
||||
|
||||
job->addNetAction(listDownload = CacheDownload::make(QUrl(URLConstants::LITELOADER_URL),
|
||||
liteloaderEntry));
|
||||
job->addNetAction(listDownload = Net::Download::makeCached(QUrl(URLConstants::LITELOADER_URL), liteloaderEntry));
|
||||
|
||||
connect(listDownload.get(), SIGNAL(failed(int)), SLOT(listFailed()));
|
||||
|
||||
|
|
@ -167,8 +166,7 @@ void LLListLoadTask::listDownloaded()
|
|||
{
|
||||
QByteArray data;
|
||||
{
|
||||
auto dlJob = listDownload;
|
||||
auto filename = std::dynamic_pointer_cast<CacheDownload>(dlJob)->getTargetFilepath();
|
||||
auto filename = listDownload->getTargetFilepath();
|
||||
QFile listFile(filename);
|
||||
if (!listFile.open(QIODevice::ReadOnly))
|
||||
{
|
||||
|
|
@ -177,7 +175,7 @@ void LLListLoadTask::listDownloaded()
|
|||
}
|
||||
data = listFile.readAll();
|
||||
listFile.close();
|
||||
dlJob.reset();
|
||||
listDownload.reset();
|
||||
}
|
||||
|
||||
QJsonParseError jsonError;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue