From 9636de7cd4bc0eaced1a9503f5d0bba92ca325e8 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 16 Apr 2018 11:31:53 +0200 Subject: [PATCH] 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 --- src/plugins/coreplugin/editortoolbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/editortoolbar.cpp b/src/plugins/coreplugin/editortoolbar.cpp index 3383325e4cd..ea3ef78019a 100644 --- a/src/plugins/coreplugin/editortoolbar.cpp +++ b/src/plugins/coreplugin/editortoolbar.cpp @@ -322,7 +322,7 @@ void EditorToolBar::setCurrentEditor(IEditor *editor) IDocument *document = editor ? editor->document() : 0; const Utils::optional 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.