Commit fbdd4fbf authored by Marco Bubke's avatar Marco Bubke
Browse files

Disable the write locker in the model attach and detach functions

And activate them in all other write functions.
parent 8dca852b
......@@ -58,7 +58,7 @@ BindingProperty::BindingProperty(const QString &propertyName, const Internal::In
void BindingProperty::setExpression(const QString &expression)
{
//Internal::WriteLocker locker(model());
Internal::WriteLocker locker(model());
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
......@@ -162,7 +162,7 @@ AbstractProperty BindingProperty::resolveToProperty() const
void BindingProperty::setDynamicTypeNameAndExpression(const QString &typeName, const QString &expression)
{
//Internal::WriteLocker locker(model());
Internal::WriteLocker locker(model());
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
......
......@@ -1108,7 +1108,7 @@ The view is informed that it has been registered within the model by a call to A
*/
void Model::attachView(AbstractView *view)
{
Internal::WriteLocker locker(m_d);
// Internal::WriteLocker locker(m_d);
m_d->attachView(view);
}
......@@ -1122,7 +1122,7 @@ void Model::attachView(AbstractView *view)
*/
void Model::detachView(AbstractView *view, ViewNotification emitDetachNotify)
{
Internal::WriteLocker locker(m_d);
// Internal::WriteLocker locker(m_d);
bool emitNotify = (emitDetachNotify == NotifyView);
m_d->detachView(view, emitNotify);
}
......
......@@ -174,7 +174,7 @@ bool ModelNode::isValidId(const QString &id)
void ModelNode::setId(const QString& id)
{
//Internal::WriteLocker locker(m_model.data());
Internal::WriteLocker locker(m_model.data());
if (!isValid()) {
Q_ASSERT_X(isValid(), Q_FUNC_INFO, "model node is invalid");
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
......@@ -208,7 +208,7 @@ QString ModelNode::type() const
*/
void ModelNode::changeType(const QString &type, int majorVersion, int minorVersion)
{
//Internal::WriteLocker locker(m_model.data());
Internal::WriteLocker locker(m_model.data());
if (!isValid()) {
Q_ASSERT_X(isValid(), Q_FUNC_INFO, "model node is invalid");
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
......
......@@ -68,7 +68,7 @@ void NodeAbstractProperty::reparentHere(const ModelNode &modelNode)
void NodeAbstractProperty::reparentHere(const ModelNode &modelNode, bool isNodeList)
{
//Internal::WriteLocker locker(model());
Internal::WriteLocker locker(model());
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
......
......@@ -101,7 +101,7 @@ const QList<QmlObjectNode> NodeListProperty::toQmlObjectNodeList() const
void NodeListProperty::slide(int from, int to) const
{
//Internal::WriteLocker locker(model());
Internal::WriteLocker locker(model());
if (!isValid())
throw InvalidPropertyException(__LINE__, __FUNCTION__, __FILE__, "<invalid node list property>");
if (to > toModelNodeList().count() - 1)
......
......@@ -57,7 +57,7 @@ VariantProperty::VariantProperty(const QString &propertyName, const Internal::In
void VariantProperty::setValue(const QVariant &value)
{
//Internal::WriteLocker locker(model());
Internal::WriteLocker locker(model());
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
......@@ -97,7 +97,7 @@ VariantProperty& VariantProperty::operator= (const QVariant &value)
void VariantProperty::setDynamicTypeNameAndValue(const QString &type, const QVariant &value)
{
//Internal::WriteLocker locker(model());
Internal::WriteLocker locker(model());
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
......
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