Update internal block copy, total_done after last progress report (#762367)

Previously total_done was updated in copy_thread() after copying of the
blocks, but importantly before the last call to set_progress_info() to
update the progress bar.  Having total_done varying during the copy of a
single range of blocks, single call to copy_blocks::copy(), is an
impediment to being able to report a single progress bar across the
whole internal copy operation.

Move updating of total_done to copy() immediately after copy_thread()
completes.

Bug 762367 - Use a single progress bar for the whole of the internal
             copy operation
This commit is contained in:
Mike Fleetwood 2016-02-13 12:37:40 +00:00 committed by Curtis Gedak
parent 6d28a62077
commit 2f2280e3d5
1 changed files with 3 additions and 1 deletions

View File

@ -128,7 +128,6 @@ void copy_blocks::copy_thread()
timer_progress_timeout.reset();
}
}
total_done += llabs( done );
//close and destroy the devices..
ped_device_close( lp_device_src );
@ -169,6 +168,9 @@ bool copy_blocks::copy()
Glib::Thread::create( sigc::mem_fun( *this, &copy_blocks::copy_thread ),
false );
Gtk::Main::run();
total_done += llabs( done );
if (done == length || !success)
{
//final description