Commit 00923dec authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

It's a boolean

parent 03242292
Pipeline #201037 skipped
......@@ -38,10 +38,10 @@ void SieveEditorTabWidget::slotTabContextMenuRequest(const QPoint &pos)
}
QMenu menu(this);
const int countTab = (count() > 1);
const bool hasMoreThanTwoTab = (count() > 1);
QAction *closeTab = nullptr;
if ((indexBar != 0) && countTab) {
if ((indexBar != 0) && hasMoreThanTwoTab) {
closeTab = menu.addAction(i18nc("@action:inmenu", "Close Tab"));
closeTab->setIcon(QIcon::fromTheme(QStringLiteral("tab-close")));
}
......@@ -53,9 +53,9 @@ void SieveEditorTabWidget::slotTabContextMenuRequest(const QPoint &pos)
}
QAction *allTab = nullptr;
if (countTab) {
if (hasMoreThanTwoTab) {
allTab = menu.addAction(i18nc("@action:inmenu", "Close All Tabs"));
allTab->setEnabled(countTab);
allTab->setEnabled(hasMoreThanTwoTab);
allTab->setIcon(QIcon::fromTheme(QStringLiteral("tab-close")));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment