aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/coreplugin/editortoolbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/coreplugin/editortoolbar.cpp')
-rw-r--r--src/plugins/coreplugin/editortoolbar.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/plugins/coreplugin/editortoolbar.cpp b/src/plugins/coreplugin/editortoolbar.cpp
index 28ed8a9acc..c23aaa49d2 100644
--- a/src/plugins/coreplugin/editortoolbar.cpp
+++ b/src/plugins/coreplugin/editortoolbar.cpp
@@ -298,8 +298,10 @@ void EditorToolBar::setToolbarCreationFlags(ToolbarCreationFlags flags)
{
d->m_isStandalone = flags & FlagsStandalone;
if (d->m_isStandalone) {
- connect(EditorManager::instance(), &EditorManager::currentEditorChanged,
- this, &EditorToolBar::updateEditorListSelection);
+ connect(EditorManager::instance(),
+ &EditorManager::currentEditorChanged,
+ this,
+ &EditorToolBar::setCurrentEditor);
disconnect(d->m_editorList, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &EditorToolBar::listSelectionActivated);
@@ -330,15 +332,6 @@ void EditorToolBar::setCurrentEditor(IEditor *editor)
updateDocumentStatus(document);
}
-void EditorToolBar::updateEditorListSelection(IEditor *newSelection)
-{
- if (newSelection) {
- const Utils::optional<int> index = DocumentModel::rowOfDocument(newSelection->document());
- if (QTC_GUARD(index))
- d->m_editorList->setCurrentIndex(index.value());
- }
-}
-
void EditorToolBar::changeActiveEditor(int row)
{
EditorManager::activateEditorForEntry(DocumentModel::entryAtRow(row));