Verified Commit e35dc852 authored by Andre Heinecke's avatar Andre Heinecke
Browse files

Print finalizing message on 100% progress

When the progress of a task collection reaches 100% but it
is not finished it means usually that it is still waiting for
data to write out for example an archive to be extracted.

This way we show some indication that we are actually still doing
something and a knight rider progress.
parent 23f93959
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
#include <cmath> #include <cmath>
#include <KLocalizedString>
using namespace Kleo; using namespace Kleo;
using namespace Kleo::Crypto; using namespace Kleo::Crypto;
...@@ -153,7 +155,13 @@ void TaskCollection::Private::calculateAndEmitProgress() ...@@ -153,7 +155,13 @@ void TaskCollection::Private::calculateAndEmitProgress()
// Scale down to avoid range issues. // Scale down to avoid range issues.
int scaled = 1000 * (m_progress / static_cast<double>(m_totalProgress)); int scaled = 1000 * (m_progress / static_cast<double>(m_totalProgress));
qCDebug(KLEOPATRA_LOG) << "Collection Progress: " << scaled << " total: " << 1000; qCDebug(KLEOPATRA_LOG) << "Collection Progress: " << scaled << " total: " << 1000;
if (total == processed) {
// This can happen when an output is finalizing, e.g. extracting an
// archive.
Q_EMIT q->progress(i18n("Finalizing output..."), 0, 0);
} else {
Q_EMIT q->progress(m_lastProgressMessage, scaled, 1000); Q_EMIT q->progress(m_lastProgressMessage, scaled, 1000);
}
} else { } else {
if (total < processed) { if (total < processed) {
qCDebug(KLEOPATRA_LOG) << "Total progress is smaller then current progress."; qCDebug(KLEOPATRA_LOG) << "Total progress is smaller then current progress.";
......
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