From da5ba10f32e07624440e12fa05b42abfa43aeb9d Mon Sep 17 00:00:00 2001 From: con Date: Fri, 16 Apr 2010 10:35:54 +0200 Subject: [PATCH] Mac: Show modified state in window decoration. Task-number: QTCREATORBUG-1118 --- src/plugins/coreplugin/editormanager/editormanager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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());