forked from qt-creator/qt-creator
QmlDesigner: Remove some more valid checks
Change-Id: Ia656d4ddf54d1a97b7950dc0762ff32eb7b037fc Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user