summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElvis Angelaccio <[email protected]>2016-05-07 13:40:18 +0200
committerElvis Angelaccio <[email protected]>2016-05-27 19:55:20 +0200
commit506e19405977caed98d1e7f02d1240c1d1d50d97 (patch)
tree263312b1c41bed93dbcf7a1401c33fb125f8ef03
parent0c8e5af5cb68c2ebf2da0cb169d62556a12d9d71 (diff)
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
-rw-r--r--kerfuffle/cliinterface.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/kerfuffle/cliinterface.cpp b/kerfuffle/cliinterface.cpp
index c8f86cf..b1fa941 100644
--- a/kerfuffle/cliinterface.cpp
+++ b/kerfuffle/cliinterface.cpp
@@ -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)) {