Commit 47251cd2 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Folder: Mark most fields as immutable

parent 72de8fe4
......@@ -46,15 +46,14 @@ int64_t Folder::* const Folder::Table::PrimaryKey = &Folder::m_id;
Folder::Folder( MediaLibraryPtr ml, sqlite::Row& row )
: m_ml( ml )
, m_id( row.load<decltype(m_id)>( 0 ) )
, m_path( row.load<decltype(m_path)>( 1 ) )
, m_parent( row.load<decltype(m_parent)>( 2 ) )
, m_isBlacklisted( row.load<decltype(m_isBlacklisted)>( 3 ) )
, m_deviceId( row.load<decltype(m_deviceId)>( 4 ) )
// Skip is_present
, m_isRemovable( row.load<decltype(m_isRemovable)>( 6 ) )
{
bool dummy;
row >> m_id
>> m_path
>> m_parent
>> m_isBlacklisted
>> m_deviceId
>> dummy
>> m_isRemovable;
}
Folder::Folder(MediaLibraryPtr ml, const std::string& path, int64_t parent, int64_t deviceId, bool isRemovable )
......
......@@ -94,10 +94,10 @@ private:
// This contains the path relative to the device mountpoint (ie. excluding it)
// or the full path (including mrl scheme) for folders on non removable devices
std::string m_path;
int64_t m_parent;
bool m_isBlacklisted;
int64_t m_deviceId;
bool m_isRemovable;
const int64_t m_parent;
const bool m_isBlacklisted;
const int64_t m_deviceId;
const bool m_isRemovable;
mutable Cache<std::string> m_deviceMountpoint;
mutable Cache<std::shared_ptr<Device>> m_device;
......
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