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



commit 2f2280e3d582cecb1163e56c0f299f0b1c673c69
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Sat Feb 13 12:37:40 2016 +0000

    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

 src/Copy_Blocks.cc |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/Copy_Blocks.cc b/src/Copy_Blocks.cc
index 308f5d7..79f6cb6 100644
--- a/src/Copy_Blocks.cc
+++ b/src/Copy_Blocks.cc
@@ -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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]