Minor code improvements

This commit is contained in:
Valentino Orlandi 2024-01-21 21:14:38 +01:00
parent fc92115597
commit 8a0bb2046d
Signed by: elB4RTO
GPG key ID: 1719E976DB2D4E71
3 changed files with 19 additions and 21 deletions

View file

@ -23,9 +23,9 @@ void DbQuery::setDialogLevel(const int new_level ) noexcept
this->dialog_level = new_level;
}
void DbQuery::setDbPath( const std::string& path ) noexcept
void DbQuery::setDbPath( std::string&& path ) noexcept
{
this->db_path = path;
this->db_path = std::move(path);
this->db_name = QString::fromStdString( this->db_path.substr( this->db_path.find_last_of( '/' ) + 1ul ) );
}

View file

@ -53,7 +53,7 @@ public:
/*!
\see Crapview::setDbPath()
*/
void setDbPath( const std::string& path ) noexcept;
void setDbPath( std::string&& path ) noexcept;
/*const std::string getDbPath( const int web_server );*/

View file

@ -149,11 +149,9 @@ QString printableDate( const int year, const int month, const int day ) noexcept
QString printableBool( const int value ) noexcept
{
if ( value == 0 ) {
return TR::tr( BOOLS__FALSE.c_str() );
} else {
return TR::tr( BOOLS__TRUE.c_str() );
}
return value == 0
? TR::tr( BOOLS__FALSE.c_str() )
: TR::tr( BOOLS__TRUE.c_str() );
}
} // namespace PrintSec