move some functions from MMCZip to use libarchive
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
@@ -66,11 +66,7 @@ void Technic::SingleZipPackInstallTask::downloadSucceeded()
|
||||
qDebug() << "Attempting to create instance from" << m_archivePath;
|
||||
|
||||
// open the zip and find relevant files in it
|
||||
m_packZip.reset(new QuaZip(m_archivePath));
|
||||
if (!m_packZip->open(QuaZip::mdUnzip)) {
|
||||
emitFailed(tr("Unable to open supplied modpack zip file."));
|
||||
return;
|
||||
}
|
||||
m_packZip.reset(new MMCZip::ArchiveReader(m_archivePath));
|
||||
m_extractFuture =
|
||||
QtConcurrent::run(QThreadPool::globalInstance(), MMCZip::extractSubDir, m_packZip.get(), QString(""), extractDir.absolutePath());
|
||||
connect(&m_extractFutureWatcher, &QFutureWatcher<QStringList>::finished, this, &Technic::SingleZipPackInstallTask::extractFinished);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "InstanceTask.h"
|
||||
#include "archive/ArchiveReader.h"
|
||||
#include "net/NetJob.h"
|
||||
|
||||
#include <quazip/quazip.h>
|
||||
@@ -54,7 +55,7 @@ class SingleZipPackInstallTask : public InstanceTask {
|
||||
QString m_minecraftVersion;
|
||||
QString m_archivePath;
|
||||
NetJob::Ptr m_filesNetJob;
|
||||
std::unique_ptr<QuaZip> m_packZip;
|
||||
std::unique_ptr<MMCZip::ArchiveReader> m_packZip;
|
||||
QFuture<std::optional<QStringList>> m_extractFuture;
|
||||
QFutureWatcher<std::optional<QStringList>> m_extractFutureWatcher;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user