diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2019-10-31 15:34:50 +0100 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2019-11-01 09:09:47 +0000 |
commit | eabc5e2bddd1a6e42d0bff323a7f4dea86610bb4 (patch) | |
tree | 9385c6ffb0e9b33e28e218639e184209a8d21f7a | |
parent | d13f7331b814d52fc72c57843030a2a35c9911b3 (diff) | |
download | qt-creator-eabc5e2bddd1a6e42d0bff323a7f4dea86610bb4.tar.gz |
Core: Simplify
bugprone-branch-clone
readability-simplify-boolean-expr
Change-Id: I294133af65f68c3b9fc1f4c6fb0b93b9ff179a6e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r-- | src/plugins/coreplugin/editormanager/editormanager.cpp | 4 | ||||
-rw-r--r-- | 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<QToolButton*>(widget)) { - widget->setAttribute(Qt::WA_Hover); - widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2); - } else if (qobject_cast<QLineEdit*>(widget)) { + if (qobject_cast<QToolButton*>(widget) || qobject_cast<QLineEdit*>(widget)) { widget->setAttribute(Qt::WA_Hover); widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2); } else if (qobject_cast<QLabel*>(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<QTabBar*>(widget)) - widget->setAttribute(Qt::WA_Hover, false); - else if (qobject_cast<QToolBar*>(widget)) - widget->setAttribute(Qt::WA_Hover, false); - else if (qobject_cast<QComboBox*>(widget)) + if (qobject_cast<QTabBar*>(widget) + || qobject_cast<QToolBar*>(widget) + || qobject_cast<QComboBox*>(widget)) { widget->setAttribute(Qt::WA_Hover, false); + } } } |