forked from qt-creator/qt-creator
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:
@@ -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.
|
||||
|
Reference in New Issue
Block a user