From 2fba3888dc76f92855b2e72cf57f46273bfffe4b Mon Sep 17 00:00:00 2001
From: mae <qt-info@nokia.com>
Date: Tue, 10 Nov 2009 17:10:39 +0100
Subject: [PATCH] Fix combobox tooltip and lock-button visibility for empty
 editor views

Reviewed-by: con
---
 src/plugins/coreplugin/editormanager/editorview.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp
index 743d2f728e6..93e59ff1594 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());
-- 
GitLab