Commit 506e1940 authored by Elvis Angelaccio's avatar Elvis Angelaccio

Fix broken corrupt queris

Ark currently always loads a corrupt archive, even if the user clicks `Don't Open`.

This is due to the `finished()` signal already emitted when the query pops up.
A simple fix is to run the query in `processFinished()`, if we detected that the
archive is corrupt.

Differential Revision: D1553

Task: T2225
parent 0c8e5af5
......@@ -304,12 +304,22 @@ void CliInterface::processFinished(int exitCode, QProcess::ExitStatus exitStatus
}
}
emit progress(1.0);
if (m_operationMode == Add) {
list();
} else {
} else if (!isCorrupt()) {
emit progress(1.0);
emit finished(true);
} else {
Kerfuffle::LoadCorruptQuery query(filename());
emit userQuery(&query);
query.waitForResponse();
if (!query.responseYes()) {
emit cancelled();
emit finished(false);
} else {
emit progress(1.0);
emit finished(true);
}
}
}
......@@ -1072,14 +1082,6 @@ void CliInterface::handleLine(const QString& line)
if (checkForErrorMessage(line, CorruptArchivePatterns)) {
qCWarning(ARK) << "Archive corrupt";
setCorrupt(true);
Kerfuffle::LoadCorruptQuery query(filename());
emit userQuery(&query);
query.waitForResponse();
if (!query.responseYes()) {
emit cancelled();
killProcess();
return;
}
}
if (handleFileExistsMessage(line)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment