diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 42d3e59a23e..637899e1ef8 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -844,8 +844,10 @@ bool EditorManager::closeEditors(const QList &editorsToClose, bool ask activateEditor(currentSplitterOrView->view(), editor); } - if (!currentEditor()) + if (!currentEditor()) { emit currentEditorChanged(0); + updateActions(); + } return !closingFailed; } @@ -1527,6 +1529,7 @@ void EditorManager::updateActions() fName = curEditor->displayName(); } + window()->setWindowModified(curEditor->file()->isModified()); if (curEditor->file()->isModified() && curEditor->file()->isReadOnly()) { // we are about to change a read-only file, warn user showEditorInfoBar(QLatin1String("Core.EditorManager.MakeWritable"), @@ -1535,6 +1538,8 @@ void EditorManager::updateActions() } else { hideEditorInfoBar(QLatin1String("Core.EditorManager.MakeWritable")); } + } else { // curEditor + window()->setWindowModified(false); } m_d->m_saveAction->setEnabled(curEditor != 0 && curEditor->file()->isModified());