diff options
Diffstat (limited to 'api/logic/minecraft/forge')
-rw-r--r-- | api/logic/minecraft/forge/ForgeInstaller.cpp | 2 | ||||
-rw-r--r-- | api/logic/minecraft/forge/ForgeVersionList.cpp | 16 | ||||
-rw-r--r-- | api/logic/minecraft/forge/ForgeVersionList.h | 4 |
3 files changed, 9 insertions, 13 deletions
diff --git a/api/logic/minecraft/forge/ForgeInstaller.cpp b/api/logic/minecraft/forge/ForgeInstaller.cpp index 353328ab..4d004bf5 100644 --- a/api/logic/minecraft/forge/ForgeInstaller.cpp +++ b/api/logic/minecraft/forge/ForgeInstaller.cpp @@ -397,7 +397,7 @@ protected: if (entry->isStale()) { NetJob *fjob = new NetJob("Forge download"); - fjob->addNetAction(CacheDownload::make(forgeVersion->url(), entry)); + fjob->addNetAction(Net::Download::makeCached(forgeVersion->url(), entry)); connect(fjob, &NetJob::progress, this, &Task::setProgress); connect(fjob, &NetJob::status, this, &Task::setStatus); connect(fjob, &NetJob::failed, [this](QString reason) diff --git a/api/logic/minecraft/forge/ForgeVersionList.cpp b/api/logic/minecraft/forge/ForgeVersionList.cpp index de185e5f..fe024780 100644 --- a/api/logic/minecraft/forge/ForgeVersionList.cpp +++ b/api/logic/minecraft/forge/ForgeVersionList.cpp @@ -131,10 +131,8 @@ void ForgeListLoadTask::executeTask() forgeListEntry->setStale(true); gradleForgeListEntry->setStale(true); - job->addNetAction(listDownload = CacheDownload::make(QUrl(URLConstants::FORGE_LEGACY_URL), - forgeListEntry)); - job->addNetAction(gradleListDownload = CacheDownload::make( - QUrl(URLConstants::FORGE_GRADLE_URL), gradleForgeListEntry)); + job->addNetAction(listDownload = Net::Download::makeCached(QUrl(URLConstants::FORGE_LEGACY_URL),forgeListEntry)); + job->addNetAction(gradleListDownload = Net::Download::makeCached(QUrl(URLConstants::FORGE_GRADLE_URL), gradleForgeListEntry)); connect(listDownload.get(), SIGNAL(failed(int)), SLOT(listFailed())); connect(gradleListDownload.get(), SIGNAL(failed(int)), SLOT(gradleListFailed())); @@ -154,15 +152,14 @@ bool ForgeListLoadTask::parseForgeList(QList<BaseVersionPtr> &out) { 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)) { return false; } data = listFile.readAll(); - dlJob.reset(); + listDownload.reset(); } QJsonParseError jsonError; @@ -266,15 +263,14 @@ bool ForgeListLoadTask::parseForgeGradleList(QList<BaseVersionPtr> &out) QMap<int, std::shared_ptr<ForgeVersion>> lookup; QByteArray data; { - auto dlJob = gradleListDownload; - auto filename = std::dynamic_pointer_cast<CacheDownload>(dlJob)->getTargetFilepath(); + auto filename = gradleListDownload->getTargetFilepath(); QFile listFile(filename); if (!listFile.open(QIODevice::ReadOnly)) { return false; } data = listFile.readAll(); - dlJob.reset(); + gradleListDownload.reset(); } QJsonParseError jsonError; diff --git a/api/logic/minecraft/forge/ForgeVersionList.h b/api/logic/minecraft/forge/ForgeVersionList.h index 62c08b2a..7b30bbb4 100644 --- a/api/logic/minecraft/forge/ForgeVersionList.h +++ b/api/logic/minecraft/forge/ForgeVersionList.h @@ -81,8 +81,8 @@ protected: NetJobPtr listJob; ForgeVersionList *m_list; - CacheDownloadPtr listDownload; - CacheDownloadPtr gradleListDownload; + Net::Download::Ptr listDownload; + Net::Download::Ptr gradleListDownload; private: bool parseForgeList(QList<BaseVersionPtr> &out); |