simplified algorithm to get remaining time

* src/GParted_Core.cc: simplified algorithm to get remaining time
This commit is contained in:
Bart Hakvoort 2006-09-03 20:52:43 +00:00
parent 9cbfca1c6e
commit 1cd71ef2f2
2 changed files with 5 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2006-09-03 Bart Hakvoort <hakvoort@cvs.gnome.org>
* src/GParted_Core.cc: simplified algorithm to get remaining time
2006-09-03 Bart Hakvoort <hakvoort@cvs.gnome.org>
* include/GParted_Core.h,

View File

@ -1651,9 +1651,7 @@ void GParted_Core::set_progress_info( Sector total,
{
operationdetail .fraction = done / static_cast<double>( 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 ),