diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index 743d2f728e61733199e895fbc65b7a828647a862..93e59ff1594db9bdbcb764974525f0b3699ec22e 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -343,6 +343,7 @@ void EditorView::setCurrentEditor(IEditor *editor) { if (!editor || m_container->count() <= 0 || m_container->indexOf(editor->widget()) == -1) { + updateEditorStatus(0); // ### TODO the combo box m_editorList should show an empty item return; } @@ -377,6 +378,13 @@ void EditorView::updateEditorStatus(IEditor *editor) static const QIcon lockedIcon(QLatin1String(":/core/images/locked.png")); static const QIcon unlockedIcon(QLatin1String(":/core/images/unlocked.png")); + m_lockButton->setVisible(editor != 0); + + if (!editor) { + m_editorList->setToolTip(QString()); + return; + } + if (editor->file()->isReadOnly()) { m_lockButton->setIcon(lockedIcon); m_lockButton->setEnabled(!editor->file()->fileName().isEmpty());