diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-09-30 02:34:46 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-09-30 02:34:46 +0200 |
commit | 8b0f8b9e597eb50ff9323037fd5fa1b9e330c467 (patch) | |
tree | 3b6613d6c7672803c371ef7043cf35b713b975b1 /logic/net/DownloadJob.cpp | |
parent | 604162acdf5283a9759c1b3ce9e90887a6599ce7 (diff) | |
download | MultiMC-8b0f8b9e597eb50ff9323037fd5fa1b9e330c467.tar MultiMC-8b0f8b9e597eb50ff9323037fd5fa1b9e330c467.tar.gz MultiMC-8b0f8b9e597eb50ff9323037fd5fa1b9e330c467.tar.lz MultiMC-8b0f8b9e597eb50ff9323037fd5fa1b9e330c467.tar.xz MultiMC-8b0f8b9e597eb50ff9323037fd5fa1b9e330c467.zip |
``Working'' forge unpackers. Needs a lot of hardening but good for alpha.
Diffstat (limited to 'logic/net/DownloadJob.cpp')
-rw-r--r-- | logic/net/DownloadJob.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/logic/net/DownloadJob.cpp b/logic/net/DownloadJob.cpp index 8da1f39b..03a69555 100644 --- a/logic/net/DownloadJob.cpp +++ b/logic/net/DownloadJob.cpp @@ -7,7 +7,7 @@ #include <QDebug> -ByteArrayDownloadPtr DownloadJob::add(QUrl url) +ByteArrayDownloadPtr DownloadJob::addByteArrayDownload(QUrl url) { ByteArrayDownloadPtr ptr(new ByteArrayDownload(url)); ptr->index_within_job = downloads.size(); @@ -17,7 +17,7 @@ ByteArrayDownloadPtr DownloadJob::add(QUrl url) return ptr; } -FileDownloadPtr DownloadJob::add(QUrl url, QString rel_target_path) +FileDownloadPtr DownloadJob::addFileDownload(QUrl url, QString rel_target_path) { FileDownloadPtr ptr(new FileDownload(url, rel_target_path)); ptr->index_within_job = downloads.size(); @@ -27,7 +27,7 @@ FileDownloadPtr DownloadJob::add(QUrl url, QString rel_target_path) return ptr; } -CacheDownloadPtr DownloadJob::add(QUrl url, MetaEntryPtr entry) +CacheDownloadPtr DownloadJob::addCacheDownload(QUrl url, MetaEntryPtr entry) { CacheDownloadPtr ptr(new CacheDownload(url, entry)); ptr->index_within_job = downloads.size(); @@ -37,6 +37,16 @@ CacheDownloadPtr DownloadJob::add(QUrl url, MetaEntryPtr entry) return ptr; } +ForgeXzDownloadPtr DownloadJob::addForgeXzDownload(QUrl url, MetaEntryPtr entry) +{ + ForgeXzDownloadPtr ptr(new ForgeXzDownload(url, entry)); + ptr->index_within_job = downloads.size(); + downloads.append(ptr); + parts_progress.append(part_info()); + total_progress++; + return ptr; +} + void DownloadJob::partSucceeded(int index) { // do progress. all slots are 1 in size at least |