Commit 19573875 authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner: crash fix in document handling

If in case of an error we should not detach the rewriter
and we always should attach the other views for simplicity.

The model is a valid ( Item {} ) and all the views are in a proper state.

This makes recovering and changing the mode back simpler, since the error
case is not a special one.

We do disable the widgets and show the error message of course.

Change-Id: I433a31a3c9ae36909089dff4d1eb1716141e809b
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent d5345496
......@@ -290,15 +290,14 @@ void QmlDesignerPlugin::activateAutoSynchronization()
resetModelSelection();
viewManager().attachComponentView();
viewManager().attachViewsExceptRewriterAndComponetView();
QList<RewriterView::Error> errors = currentDesignDocument()->qmlSyntaxErrors();
if (errors.isEmpty()) {
viewManager().attachComponentView();
viewManager().attachViewsExceptRewriterAndComponetView();
selectModelNodeUnderTextCursor();
m_mainWidget->enableWidgets();
} else {
viewManager().detachRewriterView();
m_mainWidget->disableWidgets();
m_mainWidget->showErrorMessage(errors);
}
......
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