Core: Simplify

bugprone-branch-clone
readability-simplify-boolean-expr

Change-Id: I294133af65f68c3b9fc1f4c6fb0b93b9ff179a6e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Nikolai Kosjar
2019-10-31 15:34:50 +01:00
parent d13f7331b8
commit eabc5e2bdd
2 changed files with 6 additions and 12 deletions

View File

@@ -2427,9 +2427,7 @@ IEditor *EditorManager::currentEditor()
bool EditorManager::closeAllEditors(bool askAboutModifiedEditors) bool EditorManager::closeAllEditors(bool askAboutModifiedEditors)
{ {
DocumentModelPrivate::removeAllSuspendedEntries(); DocumentModelPrivate::removeAllSuspendedEntries();
if (closeDocuments(DocumentModel::openedDocuments(), askAboutModifiedEditors)) return closeDocuments(DocumentModel::openedDocuments(), askAboutModifiedEditors);
return true;
return false;
} }
void EditorManager::closeOtherDocuments(IDocument *document) void EditorManager::closeOtherDocuments(IDocument *document)

View File

@@ -273,10 +273,7 @@ void ManhattanStyle::polish(QWidget *widget)
widget->setContentsMargins(0, 0, 0, 0); widget->setContentsMargins(0, 0, 0, 0);
widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, true); widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, true);
if (qobject_cast<QToolButton*>(widget)) { if (qobject_cast<QToolButton*>(widget) || qobject_cast<QLineEdit*>(widget)) {
widget->setAttribute(Qt::WA_Hover);
widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2);
} else if (qobject_cast<QLineEdit*>(widget)) {
widget->setAttribute(Qt::WA_Hover); widget->setAttribute(Qt::WA_Hover);
widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2); widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2);
} else if (qobject_cast<QLabel*>(widget)) { } else if (qobject_cast<QLabel*>(widget)) {
@@ -303,12 +300,11 @@ void ManhattanStyle::unpolish(QWidget *widget)
QProxyStyle::unpolish(widget); QProxyStyle::unpolish(widget);
if (panelWidget(widget)) { if (panelWidget(widget)) {
widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, false); widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, false);
if (qobject_cast<QTabBar*>(widget)) if (qobject_cast<QTabBar*>(widget)
widget->setAttribute(Qt::WA_Hover, false); || qobject_cast<QToolBar*>(widget)
else if (qobject_cast<QToolBar*>(widget)) || qobject_cast<QComboBox*>(widget)) {
widget->setAttribute(Qt::WA_Hover, false);
else if (qobject_cast<QComboBox*>(widget))
widget->setAttribute(Qt::WA_Hover, false); widget->setAttribute(Qt::WA_Hover, false);
}
} }
} }