From 075154b4e896576d0098256e481619efac9e95a9 Mon Sep 17 00:00:00 2001 From: Mike Fleetwood Date: Sun, 7 Feb 2016 13:27:03 +0000 Subject: [PATCH] Simplify XFS copy specific code progress bar usage (#760709) Remove starting and stopping the progress bar in xfs::copy(). The progress bar will be automatically started in xfs::copy_progress() callback when run_progressbar() is called; and automatically stopped in FileSystem::execute_command() when it calls stop_progress() at the end. Note that this will now not initialise the progress bar from zero immediately that the XFS copy is started, but instead 0.5 seconds into the copy when xfs::copy_progress() timed callback is called for the first time. Bug 760709 - Add progress bars to XFS and EXT2/3/4 file system specific copy methods --- src/xfs.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/xfs.cc b/src/xfs.cc index d9fa0209..1cc36a6d 100644 --- a/src/xfs.cc +++ b/src/xfs.cc @@ -254,14 +254,11 @@ bool xfs::copy( const Partition & src_part, if ( success ) { - if ( src_used > 0LL ) - operationdetail.run_progressbar( 0.0, (double)src_used, PROGRESSBAR_TEXT_COPY_BYTES ); success &= ! execute_command( "sh -c 'xfsdump -J - " + src_mount_point + " | xfsrestore -J - " + dest_mount_point + "'", operationdetail, EXEC_CHECK_STATUS|EXEC_CANCEL_SAFE|EXEC_PROGRESS_TIMED, static_cast( sigc::mem_fun( *this, &xfs::copy_progress ) ) ); - operationdetail.stop_progressbar(); success &= ! execute_command( "umount -v " + dest_part.get_path(), operationdetail, EXEC_CHECK_STATUS );