Remove unused OperationDetail members (#760709)

Remove unused members: fraction and progress_text from the
OperationDetail class now that the ProgressBar class has superseded
their use.  This also allows removal of timer_global member from the
copy_blocks class.  Timer_global was only used to track the elapsed time
copying blocks and allow the remaining time to be estimated and written
into progress_text.  The ProgressBar class also does this itself
internally.

Bug 760709 - Add progress bars to XFS and EXT2/3/4 file system specific
             copy methods
This commit is contained in:
Mike Fleetwood 2016-01-17 13:37:46 +00:00 committed by Curtis Gedak
parent b1313281bd
commit 27e30a570f
4 changed files with 2 additions and 21 deletions

View File

@ -38,7 +38,6 @@ class copy_blocks {
PedDevice *lp_device_dst;
Sector offset_src;
Sector offset_dst;
Glib::Timer timer_total;
bool success;
Glib::ustring error_message;
void copy_thread();

View File

@ -72,9 +72,6 @@ public:
void run_progressbar( double progress, double target, ProgressBar_Text text_mode = PROGRESSBAR_TEXT_NONE );
void stop_progressbar();
double fraction ;
Glib::ustring progress_text ;
sigc::signal< void, const OperationDetail & > signal_update ;
sigc::signal< void, bool > signal_cancel;
char cancelflag;

View File

@ -64,17 +64,6 @@ bool copy_blocks::set_progress_info()
Byte_Value done = llabs(this->done);
operationdetail.run_progressbar( (double)done, (double)length, PROGRESSBAR_TEXT_COPY_BYTES );
OperationDetail &operationdetail = this->operationdetail.get_last_child().get_last_child();
operationdetail.fraction = done / static_cast<double>( length );
std::time_t time_remaining = Utils::round( (length - done) / ( done / timer_total.elapsed() ) );
operationdetail.progress_text =
String::ucompose( /*TO TRANSLATORS: looks like 1.00 MiB of 16.00 MiB copied (00:01:59 remaining) */
_("%1 of %2 copied (%3 remaining)"),
Utils::format_size( done, 1 ),
Utils::format_size( length,1 ),
Utils::format_time( time_remaining ) );
operationdetail.set_description(
String::ucompose( /*TO TRANSLATORS: looks like 1.00 MiB of 16.00 MiB copied */
_("%1 of %2 copied"),
@ -182,9 +171,6 @@ bool copy_blocks::copy()
Gtk::Main::run();
if (done == length || !success)
{
//reset fraction to -1 to make room for a new one (or a pulsebar)
operationdetail.get_last_child().get_last_child().fraction = -1;
//final description
operationdetail.get_last_child().get_last_child().set_description(
String::ucompose( /*TO TRANSLATORS: looks like 1.00 MiB of 16.00 MiB copied */

View File

@ -25,13 +25,12 @@ namespace GParted
// The single progress bar for the current operation
static ProgressBar single_progressbar;
OperationDetail::OperationDetail() : fraction( -1 ), cancelflag( 0 ), status( STATUS_NONE ), time_start( -1 ),
time_elapsed( -1 )
OperationDetail::OperationDetail() : cancelflag( 0 ), status( STATUS_NONE ), time_start( -1 ), time_elapsed( -1 )
{
}
OperationDetail::OperationDetail( const Glib::ustring & description, OperationDetailStatus status, Font font ) :
fraction( -1 ), cancelflag( 0 ), status( STATUS_NONE ), time_start( -1 ), time_elapsed( -1 )
cancelflag( 0 ), status( STATUS_NONE ), time_start( -1 ), time_elapsed( -1 )
{
set_description( description, font );
set_status( status );