QmlDesigner: Remove some more valid checks

Change-Id: Ia656d4ddf54d1a97b7950dc0762ff32eb7b037fc
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Marco Bubke
2025-05-24 14:33:07 +02:00
parent 3ba7471b88
commit a92998e841
2 changed files with 3 additions and 10 deletions

View File

@@ -117,8 +117,8 @@ QmlModelState QmlObjectNode::currentState(SL sl) const
keyValue("model node", *this),
keyValue("caller location", sl)};
if (isValid())
return QmlModelState(view()->currentStateNode());
if (auto view = this->view())
return QmlModelState(view->currentStateNode());
else
return QmlModelState();
}
@@ -193,11 +193,7 @@ bool QmlObjectNode::hasBindingProperty(PropertyNameView name, SL sl) const
keyValue("model node", *this),
keyValue("caller location", sl)};
if (!isValid())
return false;
if (currentState().hasPropertyChanges(modelNode())) {
QmlPropertyChanges propertyChanges = currentState().propertyChanges(modelNode());
if (QmlPropertyChanges propertyChanges = currentState().propertyChanges(modelNode())) {
if (propertyChanges.modelNode().hasBindingProperty(name))
return true;
}

View File

@@ -172,9 +172,6 @@ QList<QmlModelStateOperation> QmlModelState::allInvalidStateOperations(SL sl) co
void QmlModelState::addChangeSetIfNotExists(const ModelNode &node)
{
if (!isValid())
return;
if (!hasPropertyChanges(node)) {
ModelNode newChangeSet;