summaryrefslogtreecommitdiff
path: root/src/plugins/todo
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2020-01-15 19:10:34 +0100
committerAlessandro Portale <alessandro.portale@qt.io>2020-01-20 20:56:57 +0000
commit24a25eed1481a7c563431d79e3ad07840c0f7125 (patch)
tree3eb8a56dac620a31e6af362bf7c03201ea645771 /src/plugins/todo
parentad4040972b9d763b2ceaa7444d18e65dd3da2ee9 (diff)
downloadqt-creator-24a25eed1481a7c563431d79e3ad07840c0f7125.tar.gz
Use isEmpty() instead of count() or size()
Change-Id: I0a89d2808c6d041da0dc41ea5aea58e6e8759bb4 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/todo')
-rw-r--r--src/plugins/todo/optionsdialog.cpp2
-rw-r--r--src/plugins/todo/todoprojectsettingswidget.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/todo/optionsdialog.cpp b/src/plugins/todo/optionsdialog.cpp
index d4b1860c8d..e06e90c9fe 100644
--- a/src/plugins/todo/optionsdialog.cpp
+++ b/src/plugins/todo/optionsdialog.cpp
@@ -144,7 +144,7 @@ void OptionsDialog::resetKeywordsButtonClicked()
void OptionsDialog::setKeywordsButtonsEnabled()
{
- bool isSomethingSelected = ui->keywordsList->selectedItems().count() != 0;
+ const bool isSomethingSelected = !ui->keywordsList->selectedItems().isEmpty();
ui->removeKeywordButton->setEnabled(isSomethingSelected);
ui->editKeywordButton->setEnabled(isSomethingSelected);
}
diff --git a/src/plugins/todo/todoprojectsettingswidget.cpp b/src/plugins/todo/todoprojectsettingswidget.cpp
index 59c544e0e5..5f2c427e8d 100644
--- a/src/plugins/todo/todoprojectsettingswidget.cpp
+++ b/src/plugins/todo/todoprojectsettingswidget.cpp
@@ -103,7 +103,7 @@ void TodoProjectSettingsWidget::prepareItem(QListWidgetItem *item) const
void TodoProjectSettingsWidget::addExcludedPatternButtonClicked()
{
- if (ui->excludedPatternsList->findItems(excludePlaceholder(), Qt::MatchFixedString).count())
+ if (!ui->excludedPatternsList->findItems(excludePlaceholder(), Qt::MatchFixedString).isEmpty())
return;
ui->excludedPatternsList->editItem(addToExcludedPatternsList(excludePlaceholder()));
}
@@ -116,7 +116,7 @@ void TodoProjectSettingsWidget::removeExcludedPatternButtonClicked()
void TodoProjectSettingsWidget::setExcludedPatternsButtonsEnabled()
{
- bool isSomethingSelected = ui->excludedPatternsList->selectedItems().count() != 0;
+ const bool isSomethingSelected = !ui->excludedPatternsList->selectedItems().isEmpty();
ui->removeExcludedPatternButton->setEnabled(isSomethingSelected);
}