diff --git a/ChangeLog b/ChangeLog index f11d645c..3c7d549e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-09-03 Bart Hakvoort + + * src/GParted_Core.cc: simplified algorithm to get remaining time + 2006-09-03 Bart Hakvoort * include/GParted_Core.h, diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc index 4b350c4a..8a5c09dc 100644 --- a/src/GParted_Core.cc +++ b/src/GParted_Core.cc @@ -1651,9 +1651,7 @@ void GParted_Core::set_progress_info( Sector total, { operationdetail .fraction = done / static_cast( total ) ; - double sec_per_frac = timer .elapsed() / operationdetail .fraction ; - - std::time_t time_remaining = Utils::round( (1.0 - operationdetail .fraction) * sec_per_frac ) ; + std::time_t time_remaining = Utils::round( (total - done) / ( done / timer .elapsed() ) ) ; operationdetail .progress_text = String::ucompose( _("%1 of %2 copied (%3 remaining)"), Utils::format_size( done ),