From ef617fdf3df484563ef3fd3e1a515042766b57e9 Mon Sep 17 00:00:00 2001 From: pvdk Date: Tue, 18 Mar 2014 00:33:31 +0100 Subject: [PATCH] Fail on the first error whilst extracting an archive --- apps/wizard/unshield/unshieldworker.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/wizard/unshield/unshieldworker.cpp b/apps/wizard/unshield/unshieldworker.cpp index 679730715f..70c780b3b8 100644 --- a/apps/wizard/unshield/unshieldworker.cpp +++ b/apps/wizard/unshield/unshieldworker.cpp @@ -752,7 +752,7 @@ bool Wizard::UnshieldWorker::extractFile(Unshield *unshield, const QString &dest success = unshield_file_save(unshield, index, array.constData()); if (!success) { - emit error(tr("Failed to extract %1.").arg(QString::fromUtf8(unshield_file_name(unshield, index))), tr("Complete path: %1.").arg(fileName)); + qDebug() << "error"; dir.remove(fileName); } @@ -783,6 +783,15 @@ bool Wizard::UnshieldWorker::extractCab(const QString &cabFile, const QString &d { if (unshield_file_is_valid(unshield, j)) { success = extractFile(unshield, destination, group->name, j, counter); + + if (!success) { + QString name(QString::fromUtf8(unshield_file_name(unshield, j))); + + emit error(tr("Failed to extract %1.").arg(name), + tr("Complete path: %1").arg(destination + QDir::separator() + name)); + return false; + } + ++counter; } }