NOISSUE fix multiple issues in ATLauncher integration

This commit is contained in:
Petr Mrázek
2021-02-09 05:04:23 +01:00
parent 434369ca7c
commit 13a7f8d3b7
11 changed files with 175 additions and 105 deletions

View File

@ -79,7 +79,7 @@ void Technic::SingleZipPackInstallTask::downloadProgressChanged(qint64 current,
void Technic::SingleZipPackInstallTask::extractFinished()
{
m_packZip.reset();
if (m_extractFuture.result().isEmpty())
if (!m_extractFuture.result())
{
emitFailed(tr("Failed to extract modpack"));
return;

View File

@ -25,6 +25,8 @@
#include <QStringList>
#include <QUrl>
#include <nonstd/optional>
namespace Technic {
class MULTIMC_LOGIC_EXPORT SingleZipPackInstallTask : public InstanceTask
@ -51,8 +53,8 @@ private:
QString m_archivePath;
NetJobPtr m_filesNetJob;
std::unique_ptr<QuaZip> m_packZip;
QFuture<QStringList> m_extractFuture;
QFutureWatcher<QStringList> m_extractFutureWatcher;
QFuture<nonstd::optional<QStringList>> m_extractFuture;
QFutureWatcher<nonstd::optional<QStringList>> m_extractFutureWatcher;
};
} // namespace Technic

View File

@ -117,7 +117,7 @@ void Technic::SolderPackInstallTask::downloadSucceeded()
while (m_modCount > i)
{
auto path = FS::PathCombine(m_outputDir.path(), QString("%1").arg(i));
if (MMCZip::extractDir(path, extractDir).isEmpty())
if (!MMCZip::extractDir(path, extractDir))
{
return false;
}