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:
Petr Mrázek
2016-05-28 19:54:17 +02:00
parent a750f6e63c
commit a1abbd9e05
51 changed files with 824 additions and 765 deletions

View File

@ -114,7 +114,7 @@ void LegacyUpdate::fmllibsStart()
auto entry = metacache->resolveEntry("fmllibs", lib.filename);
QString urlString = lib.ours ? URLConstants::FMLLIBS_OUR_BASE_URL + lib.filename
: URLConstants::FMLLIBS_FORGE_BASE_URL + lib.filename;
dljob->addNetAction(CacheDownload::make(QUrl(urlString), entry));
dljob->addNetAction(Net::Download::makeCached(QUrl(urlString), entry));
}
connect(dljob, &NetJob::succeeded, this, &LegacyUpdate::fmllibsFinished);
@ -372,7 +372,7 @@ void LegacyUpdate::jarStart()
auto metacache = ENV.metacache();
auto entry = metacache->resolveEntry("versions", URLConstants::getJarPath(version_id));
dljob->addNetAction(CacheDownload::make(QUrl(URLConstants::getLegacyJarUrl(version_id)), entry));
dljob->addNetAction(Net::Download::makeCached(QUrl(URLConstants::getLegacyJarUrl(version_id)), entry));
connect(dljob, SIGNAL(succeeded()), SLOT(jarFinished()));
connect(dljob, SIGNAL(failed(QString)), SLOT(jarFailed(QString)));
connect(dljob, SIGNAL(progress(qint64, qint64)), SIGNAL(progress(qint64, qint64)));