From eabc5e2bddd1a6e42d0bff323a7f4dea86610bb4 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 31 Oct 2019 15:34:50 +0100 Subject: Core: Simplify bugprone-branch-clone readability-simplify-boolean-expr Change-Id: I294133af65f68c3b9fc1f4c6fb0b93b9ff179a6e Reviewed-by: Eike Ziller --- src/plugins/coreplugin/editormanager/editormanager.cpp | 4 +--- src/plugins/coreplugin/manhattanstyle.cpp | 14 +++++--------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 0be92efe8a..5ec572e5a0 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -2427,9 +2427,7 @@ IEditor *EditorManager::currentEditor() bool EditorManager::closeAllEditors(bool askAboutModifiedEditors) { DocumentModelPrivate::removeAllSuspendedEntries(); - if (closeDocuments(DocumentModel::openedDocuments(), askAboutModifiedEditors)) - return true; - return false; + return closeDocuments(DocumentModel::openedDocuments(), askAboutModifiedEditors); } void EditorManager::closeOtherDocuments(IDocument *document) diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index 544f57ad3e..f64275d332 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -273,10 +273,7 @@ void ManhattanStyle::polish(QWidget *widget) widget->setContentsMargins(0, 0, 0, 0); widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, true); - if (qobject_cast(widget)) { - widget->setAttribute(Qt::WA_Hover); - widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2); - } else if (qobject_cast(widget)) { + if (qobject_cast(widget) || qobject_cast(widget)) { widget->setAttribute(Qt::WA_Hover); widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2); } else if (qobject_cast(widget)) { @@ -303,12 +300,11 @@ void ManhattanStyle::unpolish(QWidget *widget) QProxyStyle::unpolish(widget); if (panelWidget(widget)) { widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, false); - if (qobject_cast(widget)) - widget->setAttribute(Qt::WA_Hover, false); - else if (qobject_cast(widget)) - widget->setAttribute(Qt::WA_Hover, false); - else if (qobject_cast(widget)) + if (qobject_cast(widget) + || qobject_cast(widget) + || qobject_cast(widget)) { widget->setAttribute(Qt::WA_Hover, false); + } } } -- cgit v1.2.1