Return constant reference from ProgressBar::get_text()

get_text() only performs const access on the ProgressBar object so
return the member string by constant reference.

Previously done for other string returning getters, even though the
value is assigned to a variable and doesn't save anything:
    1f6e81295b
    Return constant reference from OperationDetail::get_description() (!94)
This commit is contained in:
Mike Fleetwood 2023-06-12 18:36:22 +01:00 committed by Curtis Gedak
parent f5ba53fb3e
commit af684ade52
2 changed files with 3 additions and 2 deletions

View File

@ -41,7 +41,7 @@ public:
void stop(); void stop();
bool running() const; bool running() const;
double get_fraction() const; double get_fraction() const;
Glib::ustring get_text() const; const Glib::ustring& get_text() const;
private: private:
ProgressBar( const ProgressBar & src ); // Not implemented copy constructor ProgressBar( const ProgressBar & src ); // Not implemented copy constructor

View File

@ -68,7 +68,8 @@ double ProgressBar::get_fraction() const
return m_fraction; return m_fraction;
} }
Glib::ustring ProgressBar::get_text() const
const Glib::ustring& ProgressBar::get_text() const
{ {
return m_text; return m_text;
} }