| 45 | namespace LegacyFTB { |
| 46 | |
| 47 | void PackFetchTask::fetch() |
| 48 | { |
| 49 | publicPacks.clear(); |
| 50 | thirdPartyPacks.clear(); |
| 51 | |
| 52 | jobPtr.reset(new NetJob("LegacyFTB::ModpackFetch", m_network)); |
| 53 | |
| 54 | QUrl publicPacksUrl = QUrl(BuildConfig.LEGACY_FTB_CDN_BASE_URL + "static/modpacks.xml"); |
| 55 | qDebug() << "Downloading public version info from" << publicPacksUrl.toString(); |
| 56 | jobPtr->addNetAction(Net::ApiDownload::makeByteArray(publicPacksUrl, publicModpacksXmlFileData)); |
| 57 | |
| 58 | QUrl thirdPartyUrl = QUrl(BuildConfig.LEGACY_FTB_CDN_BASE_URL + "static/thirdparty.xml"); |
| 59 | qDebug() << "Downloading thirdparty version info from" << thirdPartyUrl.toString(); |
| 60 | jobPtr->addNetAction(Net::Download::makeByteArray(thirdPartyUrl, thirdPartyModpacksXmlFileData)); |
| 61 | |
| 62 | QObject::connect(jobPtr.get(), &NetJob::succeeded, this, &PackFetchTask::fileDownloadFinished); |
| 63 | QObject::connect(jobPtr.get(), &NetJob::failed, this, &PackFetchTask::fileDownloadFailed); |
| 64 | QObject::connect(jobPtr.get(), &NetJob::aborted, this, &PackFetchTask::fileDownloadAborted); |
| 65 | |
| 66 | jobPtr->start(); |
| 67 | } |
| 68 | |
| 69 | void PackFetchTask::fetchPrivate(const QStringList& toFetch) |
| 70 | { |
no test coverage detected