[Fix-Warnings] Remove redundant parentheses

This commit is contained in:
Brübach, Lukas 2025-11-29 09:23:11 +01:00
parent 858361e6d3
commit 8ddbdf31f9
75 changed files with 269 additions and 269 deletions

View file

@ -155,7 +155,7 @@ bool CardDatabaseDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex
{
CardInfoPtr info = static_cast<CardDatabaseModel *>(sourceModel())->getCard(sourceRow);
if (((isToken == ShowTrue) && !info->getIsToken()) || ((isToken == ShowFalse) && info->getIsToken()))
if ((isToken == ShowTrue && !info->getIsToken()) || (isToken == ShowFalse && info->getIsToken()))
return false;
if (filterString != nullptr) {

View file

@ -23,8 +23,9 @@ int SetsModel::rowCount(const QModelIndex &parent) const
QVariant SetsModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid() || (index.column() >= NUM_COLS) || (index.row() >= rowCount()))
if (!index.isValid() || index.column() >= NUM_COLS || index.row() >= rowCount()) {
return QVariant();
}
CardSetPtr set = sets[index.row()];
@ -72,7 +73,7 @@ bool SetsModel::setData(const QModelIndex &index, const QVariant &value, int rol
QVariant SetsModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if ((role != Qt::DisplayRole) || (orientation != Qt::Horizontal))
if (role != Qt::DisplayRole || orientation != Qt::Horizontal)
return QVariant();
switch (section) {
case SortKeyCol:
@ -289,9 +290,9 @@ bool SetsDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex &source
const auto filter = filterRegExp();
#endif
return (sourceModel()->data(typeIndex).toString().contains(filter) ||
sourceModel()->data(nameIndex).toString().contains(filter) ||
sourceModel()->data(shortNameIndex).toString().contains(filter));
return sourceModel()->data(typeIndex).toString().contains(filter) ||
sourceModel()->data(nameIndex).toString().contains(filter) ||
sourceModel()->data(shortNameIndex).toString().contains(filter);
}
bool SetsDisplayModel::lessThan(const QModelIndex &left, const QModelIndex &right) const

View file

@ -189,7 +189,7 @@ void DeckListModel::emitBackgroundUpdates(const QModelIndex &parent)
QVariant DeckListModel::headerData(const int section, const Qt::Orientation orientation, const int role) const
{
if ((role != Qt::DisplayRole) || (orientation != Qt::Horizontal)) {
if (role != Qt::DisplayRole || orientation != Qt::Horizontal) {
return {};
}
@ -258,7 +258,7 @@ void DeckListModel::emitRecursiveUpdates(const QModelIndex &index)
bool DeckListModel::setData(const QModelIndex &index, const QVariant &value, const int role)
{
auto *node = getNode<DecklistModelCardNode *>(index);
if (!node || (role != Qt::EditRole)) {
if (!node || role != Qt::EditRole) {
return false;
}
@ -310,7 +310,7 @@ bool DeckListModel::removeRows(int row, int count, const QModelIndex &parent)
}
endRemoveRows();
if (node->empty() && (node != root)) {
if (node->empty() && node != root) {
removeRows(parent.row(), 1, parent.parent());
} else {
emitRecursiveUpdates(parent);