From 6e514de344a0bea80ff5e0ac2465cda4fb52c530 Mon Sep 17 00:00:00 2001 From: Scott Klum Date: Tue, 14 Jan 2014 19:43:25 -0500 Subject: [PATCH] Fixed progress percentage output --- openbr/core/core.cpp | 3 ++- openbr/plugins/misc.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openbr/core/core.cpp b/openbr/core/core.cpp index 91e7433..2d6e5c9 100644 --- a/openbr/core/core.cpp +++ b/openbr/core/core.cpp @@ -148,7 +148,8 @@ struct AlgorithmCore if (data.empty()) return files; - // Store totalSteps for ProgressCounter + // Store steps for ProgressCounter + Globals->currentStep = 0; Globals->totalSteps = data.length(); // Trust me, this makes complete sense. diff --git a/openbr/plugins/misc.cpp b/openbr/plugins/misc.cpp index a9cb8d4..e5616c5 100644 --- a/openbr/plugins/misc.cpp +++ b/openbr/plugins/misc.cpp @@ -522,7 +522,7 @@ class ProgressCounterTransform : public TimeVaryingTransform float p = br_progress(); int s = br_time_remaining(); - fprintf(stderr, "%05.2f%% ELAPSED=%s REMAINING=%s COUNT=%g \r", p, QtUtils::toTime(Globals->startTime.elapsed()/1000.0f).toStdString().c_str(), QtUtils::toTime(s).toStdString().c_str(), Globals->currentStep); + fprintf(stderr, "%05.2f%% ELAPSED=%s REMAINING=%s COUNT=%g \r", p*100., QtUtils::toTime(Globals->startTime.elapsed()/1000.0f).toStdString().c_str(), QtUtils::toTime(s).toStdString().c_str(), Globals->currentStep); timer.start(); } -- libgit2 0.21.4