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

Method downloadSucceeded

launcher/modplatform/technic/SingleZipPackInstallTask.cpp:57–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57void Technic::SingleZipPackInstallTask::downloadSucceeded()
58{
59 m_abortable = false;
60
61 setStatus(tr("Extracting modpack"));
62 QDir extractDir(FS::PathCombine(m_stagingPath, ".minecraft"));
63 qDebug() << "Attempting to create instance from" << m_archivePath;
64
65 // open the zip and find relevant files in it
66 m_packZip.reset(new QuaZip(m_archivePath));
67 if (!m_packZip->open(QuaZip::mdUnzip))
68 {
69 emitFailed(tr("Unable to open supplied modpack zip file."));
70 return;
71 }
72 m_extractFuture = QtConcurrent::run(QThreadPool::globalInstance(), MMCZip::extractSubDir, m_packZip.get(), QString(""), extractDir.absolutePath());
73 connect(&m_extractFutureWatcher, &QFutureWatcher<QStringList>::finished, this, &Technic::SingleZipPackInstallTask::extractFinished);
74 connect(&m_extractFutureWatcher, &QFutureWatcher<QStringList>::canceled, this, &Technic::SingleZipPackInstallTask::extractAborted);
75 m_extractFutureWatcher.setFuture(m_extractFuture);
76 m_filesNetJob.reset();
77}
78
79void Technic::SingleZipPackInstallTask::downloadFailed(QString reason)
80{

Callers

nothing calls this directly

Calls 6

PathCombineFunction · 0.85
runFunction · 0.85
QStringClass · 0.85
openMethod · 0.80
resetMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected