EditorToolBar: Replace optional::value by non-throwing alternative

...to calm down static checker which
fears throwing exceptions into dtors

Change-Id: I7f1a298e8391735d503332a7bce67e10895fbc85
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Robert Loehning
2018-04-16 11:31:53 +02:00
parent 7be7d26814
commit 9636de7cd4

View File

@@ -322,7 +322,7 @@ void EditorToolBar::setCurrentEditor(IEditor *editor)
IDocument *document = editor ? editor->document() : 0;
const Utils::optional<int> index = DocumentModel::rowOfDocument(document);
if (QTC_GUARD(index))
d->m_editorList->setCurrentIndex(index.value());
d->m_editorList->setCurrentIndex(*index);
// If we never added the toolbar from the editor, we will never change
// the editor, so there's no need to update the toolbar either.