summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft/liteloader
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-05-28 19:54:17 +0200
committerPetr Mrázek <peterix@gmail.com>2016-06-05 23:55:39 +0200
commita1abbd9e05c80584d831b1d12c27c5f7d731cece (patch)
tree3324eaf37efa228e07a0e3136952673f0bc3405a /api/logic/minecraft/liteloader
parenta750f6e63c783730380c19788deff2acfb3f4836 (diff)
downloadMultiMC-a1abbd9e05c80584d831b1d12c27c5f7d731cece.tar
MultiMC-a1abbd9e05c80584d831b1d12c27c5f7d731cece.tar.gz
MultiMC-a1abbd9e05c80584d831b1d12c27c5f7d731cece.tar.lz
MultiMC-a1abbd9e05c80584d831b1d12c27c5f7d731cece.tar.xz
MultiMC-a1abbd9e05c80584d831b1d12c27c5f7d731cece.zip
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.
Diffstat (limited to 'api/logic/minecraft/liteloader')
-rw-r--r--api/logic/minecraft/liteloader/LiteLoaderVersionList.cpp8
-rw-r--r--api/logic/minecraft/liteloader/LiteLoaderVersionList.h2
2 files changed, 4 insertions, 6 deletions
diff --git a/api/logic/minecraft/liteloader/LiteLoaderVersionList.cpp b/api/logic/minecraft/liteloader/LiteLoaderVersionList.cpp
index b0c9736a..f8bf095f 100644
--- a/api/logic/minecraft/liteloader/LiteLoaderVersionList.cpp
+++ b/api/logic/minecraft/liteloader/LiteLoaderVersionList.cpp
@@ -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;
diff --git a/api/logic/minecraft/liteloader/LiteLoaderVersionList.h b/api/logic/minecraft/liteloader/LiteLoaderVersionList.h
index 1dba4b6a..ae8bee92 100644
--- a/api/logic/minecraft/liteloader/LiteLoaderVersionList.h
+++ b/api/logic/minecraft/liteloader/LiteLoaderVersionList.h
@@ -112,7 +112,7 @@ slots:
protected:
NetJobPtr listJob;
- CacheDownloadPtr listDownload;
+ Net::Download::Ptr listDownload;
LiteLoaderVersionList *m_list;
};