forked from qt-creator/qt-creator
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:
@@ -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)
|
||||
|
@@ -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,13 +300,12 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ManhattanStyle::polish(QPalette &pal)
|
||||
|
Reference in New Issue
Block a user