MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / fetch

Method fetch

launcher/modplatform/legacy_ftb/PackFetchTask.cpp:45–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43namespace LegacyFTB {
44
45void 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
67void PackFetchTask::fetchPrivate(const QStringList & toFetch)
68{

Callers 1

openedImplMethod · 0.80

Calls 6

QUrlClass · 0.85
addNetActionMethod · 0.80
clearMethod · 0.45
toStringMethod · 0.45
getMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected