Return const reference from OperationDetail::get_progressbar()

The only use of the reference returned from
OperationDetail::get_progressbar() is to call const methods
ProgressBar::running(), ::get_fraction() and ::get_text().  Therefore
make OperationDetail::get_progressbar() return a const reference.
This commit is contained in:
Mike Fleetwood 2023-06-12 08:57:45 +01:00 committed by Curtis Gedak
parent 3cbedad693
commit f5ba53fb3e
3 changed files with 3 additions and 3 deletions

View File

@ -82,7 +82,7 @@ private:
void add_child_implement( const OperationDetail & operationdetail ); void add_child_implement( const OperationDetail & operationdetail );
void on_update( const OperationDetail & operationdetail ) ; void on_update( const OperationDetail & operationdetail ) ;
void cancel( bool force ); void cancel( bool force );
ProgressBar & get_progressbar() const; const ProgressBar& get_progressbar() const;
Glib::ustring description ; Glib::ustring description ;
OperationDetailStatus status ; OperationDetailStatus status ;

View File

@ -165,7 +165,7 @@ void Dialog_Progress::on_signal_update( const OperationDetail & operationdetail
if ( operationdetail .get_status() == STATUS_EXECUTE ) if ( operationdetail .get_status() == STATUS_EXECUTE )
label_current_sub_text = operationdetail .get_description() ; label_current_sub_text = operationdetail .get_description() ;
ProgressBar & progressbar_src = operationdetail.get_progressbar(); const ProgressBar& progressbar_src = operationdetail.get_progressbar();
if ( progressbar_src.running() ) if ( progressbar_src.running() )
{ {
if ( pulsetimer.connected() ) if ( pulsetimer.connected() )

View File

@ -227,7 +227,7 @@ void OperationDetail::cancel( bool force )
signal_cancel.emit( force ); signal_cancel.emit( force );
} }
ProgressBar & OperationDetail::get_progressbar() const const ProgressBar& OperationDetail::get_progressbar() const
{ {
return single_progressbar; return single_progressbar;
} }