Commit 959ba534 authored by mae's avatar mae
Browse files

show and hide the editor info bar in the correct view

parent 0c09777a
......@@ -484,8 +484,8 @@ void EditorManager::setCurrentEditor(IEditor *editor, bool ignoreNavigationHisto
if (addToHistory)
addCurrentPositionToNavigationHistory(true);
EditorView *view = m_d->m_splitter->findView(editor)->view();
view->setCurrentEditor(editor);
if (SplitterOrView *splitterOrView = m_d->m_splitter->findView(editor))
splitterOrView->view()->setCurrentEditor(editor);
}
updateActions();
updateEditorHistory();
......@@ -1560,19 +1560,29 @@ void EditorManager::revertToSaved()
currEditor->file()->modified(&temp);
}
Core::Internal::EditorView *EditorManager::currentEditorView()
{
if (m_d->m_currentView)
return m_d->m_currentView->view();
if (m_d->m_currentEditor)
if (SplitterOrView *splitterOrView = m_d->m_splitter->findView(m_d->m_currentEditor))
return splitterOrView->view();
return m_d->m_view;
}
void EditorManager::showEditorInfoBar(const QString &kind,
const QString &infoText,
const QString &buttonText,
QObject *object, const char *member)
{
m_d->m_view->showEditorInfoBar(kind, infoText, buttonText, object, member);
currentEditorView()->showEditorInfoBar(kind, infoText, buttonText, object, member);
}
void EditorManager::hideEditorInfoBar(const QString &kind)
{
m_d->m_view->hideEditorInfoBar(kind);
currentEditorView()->hideEditorInfoBar(kind);
}
QString EditorManager::externalEditorHelpText() const
......
......@@ -227,6 +227,7 @@ private:
void closeEditor(Core::IEditor *editor);
void closeView(Core::Internal::EditorView *view);
void emptyView(Core::Internal::EditorView *view);
Core::Internal::EditorView *currentEditorView();
IEditor *pickUnusedEditor() const;
void updateCurrentPositionInNavigationHistory();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment