Commit 0a846c68 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Hugo Beauzée-Luyssen

File: setMrl: Expect a string instead of a reference to string

parent 2b8b2323
Pipeline #5827 passed with stage
in 5 minutes and 33 seconds
......@@ -115,7 +115,7 @@ const std::string& File::rawMrl() const
return m_mrl;
}
void File::setMrl( const std::string& mrl )
void File::setMrl( std::string mrl )
{
if ( m_mrl == mrl )
return;
......@@ -123,7 +123,7 @@ void File::setMrl( const std::string& mrl )
"mrl = ? WHERE id_file = ?";
if ( sqlite::Tools::executeUpdate( m_ml->getConn(), req, mrl, m_id ) == false )
return;
m_mrl = mrl;
m_mrl = std::move( mrl );
}
IFile::Type File::type() const
......
......@@ -55,7 +55,7 @@ public:
* during a migration, but shouldn't be used otherwise, as it would be unusable
*/
const std::string& rawMrl() const;
void setMrl( const std::string& mrl );
void setMrl( std::string mrl );
virtual Type type() const override;
virtual unsigned int lastModificationDate() const override;
virtual unsigned int size() const override;
......
......@@ -1063,7 +1063,7 @@ void MediaLibrary::migrateModel9to10()
// and calling mrl would crash for files stored on removable devices.
auto newMrl = utils::url::encode( utils::url::decode( f->rawMrl() ) );
LOG_INFO( "Converting ", f->rawMrl(), " to ", newMrl );
f->setMrl( newMrl );
f->setMrl( std::move( newMrl ) );
}
m_settings.setDbModelVersion( 10 );
m_settings.save();
......@@ -1315,7 +1315,7 @@ void MediaLibrary::migrateModel15to16()
for ( auto& f : files )
{
auto newMrl = utils::url::encode( utils::url::decode( f->rawMrl() ) );
f->setMrl( newMrl );
f->setMrl( std::move( newMrl ) );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment