Commit 6d3d54a8 authored by Marco Bubke's avatar Marco Bubke Committed by Kai Koehne
Browse files

List are now handled before writable properties for reseting properties

This is fixing a crash because the code was asuming that list could be
only readonly properties.

Task-Number: BAUHAUS-589
Task-Number: BAUHAUS-568
Reviewed-by: kkoehne
parent 124bb7aa
......@@ -569,10 +569,6 @@ void ObjectNodeInstance::resetProperty(QObject *object, const QString &propertyN
if (metaProperty.isResettable()) {
metaProperty.reset();
} else if (metaProperty.isWritable()) {
if (metaProperty.read() == resetValue(propertyName))
return;
metaProperty.write(resetValue(propertyName));
} else if (metaProperty.propertyTypeCategory() == QDeclarativeProperty::List) {
QDeclarativeListReference list = qvariant_cast<QDeclarativeListReference>(metaProperty.read());
......@@ -582,6 +578,10 @@ void ObjectNodeInstance::resetProperty(QObject *object, const QString &propertyN
}
list.clear();
} else if (metaProperty.isWritable()) {
if (metaProperty.read() == resetValue(propertyName))
return;
metaProperty.write(resetValue(propertyName));
}
}
......
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