| 8 | namespace LegacyFTB { |
| 9 | |
| 10 | void PackFetchTask::fetch() |
| 11 | { |
| 12 | publicPacks.clear(); |
| 13 | thirdPartyPacks.clear(); |
| 14 | |
| 15 | jobPtr = new NetJob("LegacyFTB::ModpackFetch", m_network); |
| 16 | |
| 17 | QUrl publicPacksUrl = QUrl(BuildConfig.LEGACY_FTB_CDN_BASE_URL + "static/modpacks.xml"); |
| 18 | qDebug() << "Downloading public version info from" << publicPacksUrl.toString(); |
| 19 | jobPtr->addNetAction(Net::Download::makeByteArray(publicPacksUrl, &publicModpacksXmlFileData)); |
| 20 | |
| 21 | QUrl thirdPartyUrl = QUrl(BuildConfig.LEGACY_FTB_CDN_BASE_URL + "static/thirdparty.xml"); |
| 22 | qDebug() << "Downloading thirdparty version info from" << thirdPartyUrl.toString(); |
| 23 | jobPtr->addNetAction(Net::Download::makeByteArray(thirdPartyUrl, &thirdPartyModpacksXmlFileData)); |
| 24 | |
| 25 | QObject::connect(jobPtr.get(), &NetJob::succeeded, this, &PackFetchTask::fileDownloadFinished); |
| 26 | QObject::connect(jobPtr.get(), &NetJob::failed, this, &PackFetchTask::fileDownloadFailed); |
| 27 | |
| 28 | jobPtr->start(); |
| 29 | } |
| 30 | |
| 31 | void PackFetchTask::fetchPrivate(const QStringList & toFetch) |
| 32 | { |
no test coverage detected