forked from qt-creator/qt-creator
Move displayName from IEditor to IDocument
The display name is not editor instance specific, but belongs to the document. Change-Id: I3c936f04a86e10e6ca30063d85036d85b4b5880e Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -207,7 +207,7 @@ EditorToolBar::~EditorToolBar()
|
||||
void EditorToolBar::removeToolbarForEditor(IEditor *editor)
|
||||
{
|
||||
QTC_ASSERT(editor, return);
|
||||
disconnect(editor, SIGNAL(changed()), this, SLOT(checkEditorStatus()));
|
||||
disconnect(editor->document(), SIGNAL(changed()), this, SLOT(checkEditorStatus()));
|
||||
|
||||
QWidget *toolBar = editor->toolBar();
|
||||
if (toolBar != 0) {
|
||||
@@ -245,7 +245,7 @@ void EditorToolBar::closeEditor()
|
||||
void EditorToolBar::addEditor(IEditor *editor)
|
||||
{
|
||||
QTC_ASSERT(editor, return);
|
||||
connect(editor, SIGNAL(changed()), this, SLOT(checkEditorStatus()));
|
||||
connect(editor->document(), SIGNAL(changed()), this, SLOT(checkEditorStatus()));
|
||||
QWidget *toolBar = editor->toolBar();
|
||||
|
||||
if (toolBar && !d->m_isStandalone)
|
||||
@@ -394,7 +394,7 @@ void EditorToolBar::updateEditorStatus(IEditor *editor)
|
||||
if (editor == current)
|
||||
d->m_editorList->setToolTip(
|
||||
current->document()->filePath().isEmpty()
|
||||
? current->displayName()
|
||||
? current->document()->displayName()
|
||||
: QDir::toNativeSeparators(editor->document()->filePath())
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user