Merge remote-tracking branch 'origin/4.9' into 4.10

Change-Id: I6f1bc9381dc8c0ce8abc5a6c006087076d8fc1bc
This commit is contained in:
Eike Ziller
2019-06-18 11:48:32 +02:00
7 changed files with 19 additions and 23 deletions

View File

@@ -295,8 +295,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, QOverload<int>::of(&QComboBox::activated),
this, &EditorToolBar::listSelectionActivated);
@@ -327,15 +329,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));