Commit 72de8fe4 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

File: Mark most fields as immutable

parent 4cb30a7f
......@@ -39,18 +39,18 @@ int64_t File::* const File::Table::PrimaryKey = &File::m_id;
File::File( MediaLibraryPtr ml, sqlite::Row& row )
: m_ml( ml )
, m_id( row.extract<decltype(m_id)>() )
, m_mediaId( row.extract<decltype(m_mediaId)>() )
, m_playlistId( row.extract<decltype(m_playlistId)>() )
, m_mrl( row.extract<decltype(m_mrl)>() )
, m_type( row.extract<decltype(m_type)>() )
, m_lastModificationDate( row.extract<decltype(m_lastModificationDate)>() )
, m_size( row.extract<decltype(m_size)>() )
, m_folderId( row.extract<decltype(m_folderId)>() )
, m_isPresent( row.extract<decltype(m_isPresent)>() )
, m_isRemovable( row.extract<decltype(m_isRemovable)>() )
, m_isExternal( row.extract<decltype(m_isExternal)>() )
{
row >> m_id
>> m_mediaId
>> m_playlistId
>> m_mrl
>> m_type
>> m_lastModificationDate
>> m_size
>> m_folderId
>> m_isPresent
>> m_isRemovable
>> m_isExternal;
}
File::File( MediaLibraryPtr ml, int64_t mediaId, int64_t playlistId, Type type,
......
......@@ -104,18 +104,18 @@ private:
MediaLibraryPtr m_ml;
int64_t m_id;
int64_t m_mediaId;
int64_t m_playlistId;
const int64_t m_mediaId;
const int64_t m_playlistId;
// Contains the path relative to the containing folder for files contained in a removable folder
// or the full file MRL for non removable ones
std::string m_mrl;
Type m_type;
std::time_t m_lastModificationDate;
unsigned int m_size;
int64_t m_folderId;
bool m_isPresent;
bool m_isRemovable;
bool m_isExternal;
const Type m_type;
const std::time_t m_lastModificationDate;
const unsigned int m_size;
const int64_t m_folderId;
const bool m_isPresent;
const bool m_isRemovable;
const bool m_isExternal;
// Contains the full path as a MRL
mutable Cache<std::string> m_fullPath;
......
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