refs #601 Fixed thread safety of get() by adding getCopy().

This commit is contained in:
Mathew Sutcliffe
2016-03-10 23:30:34 +00:00
parent 3e21b718d9
commit a47a2681bd
3 changed files with 27 additions and 3 deletions

View File

@@ -422,7 +422,20 @@ namespace BlackMisc
return element;
}
bool CValuePage::isValid(const Element &element, int typeId) const
{
auto reader = element.m_value.read();
return reader->isValid() && reader->userType() == typeId;
}
const CVariant &CValuePage::getValue(const Element &element) const
{
Q_ASSERT(QThread::currentThread() == thread());
return element.m_value.read();
}
CVariant CValuePage::getValueCopy(const Element &element) const
{
return element.m_value.read();
}