MCPcopy Create free account
hub / github.com/MultiMC/Launcher / unzip

Method unzip

launcher/modplatform/legacy_ftb/PackInstallTask.cpp:78–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78void PackInstallTask::unzip()
79{
80 progress(2, 4);
81 setStatus(tr("Extracting modpack"));
82 QDir extractDir(m_stagingPath);
83
84 m_packZip.reset(new QuaZip(archivePath));
85 if(!m_packZip->open(QuaZip::mdUnzip))
86 {
87 emitFailed(tr("Failed to open modpack file %1!").arg(archivePath));
88 return;
89 }
90
91 m_extractFuture = QtConcurrent::run(QThreadPool::globalInstance(), MMCZip::extractDir, archivePath, extractDir.absolutePath() + "/unzip");
92 connect(&m_extractFutureWatcher, &QFutureWatcher<QStringList>::finished, this, &PackInstallTask::onUnzipFinished);
93 connect(&m_extractFutureWatcher, &QFutureWatcher<QStringList>::canceled, this, &PackInstallTask::onUnzipCanceled);
94 m_extractFutureWatcher.setFuture(m_extractFuture);
95}
96
97void PackInstallTask::onUnzipFinished()
98{

Callers

nothing calls this directly

Calls 3

runFunction · 0.85
openMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected