Commit 4cb30a7f authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Device: Make some fields immutable

parent f8fc7cf4
......@@ -35,13 +35,13 @@ int64_t Device::* const Device::Table::PrimaryKey = &Device::m_id;
Device::Device( MediaLibraryPtr ml, sqlite::Row& row )
: m_ml( ml )
, m_id( row.extract<decltype(m_id)>() )
, m_uuid( row.extract<decltype(m_uuid)>() )
, m_scheme( row.extract<decltype(m_scheme)>() )
, m_isRemovable( row.extract<decltype(m_isRemovable)>() )
, m_isPresent( row.extract<decltype(m_isPresent)>() )
, m_lastSeen( row.extract<decltype(m_lastSeen)>() )
{
row >> m_id
>> m_uuid
>> m_scheme
>> m_isRemovable
>> m_isPresent
>> m_lastSeen;
}
Device::Device( MediaLibraryPtr ml, const std::string& uuid, const std::string& scheme,
......
......@@ -69,9 +69,9 @@ private:
int64_t m_id;
// This is a unique ID on the system side, in the /dev/disk/by-uuid sense.
// It can be a name or what not, depending on the OS.
std::string m_uuid;
std::string m_scheme;
bool m_isRemovable;
const std::string m_uuid;
const std::string m_scheme;
const bool m_isRemovable;
bool m_isPresent;
time_t m_lastSeen;
......
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