simplify two true-false

This commit is contained in:
shenleban tongying 2022-08-23 04:32:43 -04:00
parent 708a57de1e
commit bed57aeaf6
2 changed files with 3 additions and 3 deletions

View File

@ -488,7 +488,7 @@ void RecollModel::sort(int column, Qt::SortOrder order)
if (!stringlowercmp("date", spec.field) ||
!stringlowercmp("datetime", spec.field))
spec.field = "mtime";
spec.desc = order == Qt::AscendingOrder ? false : true;
spec.desc = (order != Qt::AscendingOrder);
}
emit sortDataChanged(spec);
}

View File

@ -218,8 +218,8 @@ void SpellW::doExpand()
resTW->setItem(0, 0, new QTableWidgetItem(tr("No expansion found")));
} else {
int row = 0;
if (maxexpand > 0 && int(res.entries.size()) >= maxexpand) {
// maxexpand is static const, thus guaranteed to be >0
if (int(res.entries.size()) >= maxexpand) {
resTW->setRowCount(row + 1);
resTW->setSpan(row, 0, 1, 2);
resTW->setItem(row++, 0,