forked from qt-creator/qt-creator
Use isEmpty() instead of count() or size()
Change-Id: I0a89d2808c6d041da0dc41ea5aea58e6e8759bb4 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user