Commit 5b65a60e authored by Kai Koehne's avatar Kai Koehne
Browse files

QmlDesigner: Switch back to edit mode if last .qml file closes

Fixes multiple ways to crash QmlDesigner after last .qml file is closed
by enforcing a switch to Edit mode then.

Patch originally done by con.
parent 0531e800
......@@ -207,7 +207,7 @@ void DesignMode::unregisterDesignWidget(QWidget *widget)
// if editor changes, check if we have valid mimetype registered.
void DesignMode::currentEditorChanged(Core::IEditor *editor)
if (d-> == editor)
if (editor && (d-> == editor))
bool mimeEditorAvailable = false;
......@@ -239,6 +239,8 @@ void DesignMode::currentEditorChanged(Core::IEditor *editor)
if (!mimeEditorAvailable) {
if (core->modeManager()->currentMode() == this)
d->m_currentEditor = QWeakPointer<Core::IEditor>();
emit actionsUpdated(d->;
Supports Markdown
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