forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.9' into 4.10
Change-Id: I6f1bc9381dc8c0ce8abc5a6c006087076d8fc1bc
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user