Return constant reference from OperationDetail::get_description() (!94)

All uses of get_description() copy construct to a local variable, not
assign to a reference, so this doesn't save anything.  It is just being
done to be consistent with making other getters return a constant
reference.

Closes !94 - Make more getter methods use return-by-constant-reference
This commit is contained in:
Mike Fleetwood 2021-11-06 16:55:01 +00:00 committed by Curtis Gedak
parent 81f5dc3ead
commit 1f6e81295b
2 changed files with 5 additions and 3 deletions

View File

@ -58,7 +58,7 @@ public:
OperationDetailStatus status = STATUS_EXECUTE, OperationDetailStatus status = STATUS_EXECUTE,
Font font = FONT_NORMAL ) ; Font font = FONT_NORMAL ) ;
void set_description( const Glib::ustring & description, Font font = FONT_NORMAL ) ; void set_description( const Glib::ustring & description, Font font = FONT_NORMAL ) ;
Glib::ustring get_description() const ; const Glib::ustring& get_description() const;
void set_status( OperationDetailStatus status ) ; void set_status( OperationDetailStatus status ) ;
void set_success_and_capture_errors( bool success ); void set_success_and_capture_errors( bool success );
OperationDetailStatus get_status() const ; OperationDetailStatus get_status() const ;

View File

@ -75,11 +75,13 @@ void OperationDetail::set_description( const Glib::ustring & description, Font f
on_update( *this ) ; on_update( *this ) ;
} }
Glib::ustring OperationDetail::get_description() const
const Glib::ustring& OperationDetail::get_description() const
{ {
return description ; return description ;
} }
void OperationDetail::set_status( OperationDetailStatus status ) void OperationDetail::set_status( OperationDetailStatus status )
{ {
if ( this ->status != STATUS_ERROR ) if ( this ->status != STATUS_ERROR )