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