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
This commit is contained in:
Marco Bubke
2010-04-15 12:33:25 +02:00
committed by Kai Koehne
parent 124bb7aad7
commit 6d3d54a84f

View File

@@ -569,10 +569,6 @@ void ObjectNodeInstance::resetProperty(QObject *object, const QString &propertyN
if (metaProperty.isResettable()) { if (metaProperty.isResettable()) {
metaProperty.reset(); metaProperty.reset();
} else if (metaProperty.isWritable()) {
if (metaProperty.read() == resetValue(propertyName))
return;
metaProperty.write(resetValue(propertyName));
} else if (metaProperty.propertyTypeCategory() == QDeclarativeProperty::List) { } else if (metaProperty.propertyTypeCategory() == QDeclarativeProperty::List) {
QDeclarativeListReference list = qvariant_cast<QDeclarativeListReference>(metaProperty.read()); QDeclarativeListReference list = qvariant_cast<QDeclarativeListReference>(metaProperty.read());
@@ -582,6 +578,10 @@ void ObjectNodeInstance::resetProperty(QObject *object, const QString &propertyN
} }
list.clear(); list.clear();
} else if (metaProperty.isWritable()) {
if (metaProperty.read() == resetValue(propertyName))
return;
metaProperty.write(resetValue(propertyName));
} }
} }