Run formatter on all our files (#6942)

This commit is contained in:
RickyRister 2026-05-26 15:11:38 -07:00 committed by GitHub
parent b3c89167c5
commit 1d5d3f2d38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 153 additions and 81 deletions

View file

@ -31,8 +31,9 @@ int CardDatabaseModel::columnCount(const QModelIndex & /*parent*/) const
QVariant CardDatabaseModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid() || index.row() >= cardList.size() || index.column() >= CARDDBMODEL_COLUMNS ||
(role != Qt::DisplayRole && role != SortRole))
(role != Qt::DisplayRole && role != SortRole)) {
return QVariant();
}
CardInfoPtr card = cardList.at(index.row());
switch (index.column()) {
@ -56,10 +57,12 @@ QVariant CardDatabaseModel::data(const QModelIndex &index, int role) const
QVariant CardDatabaseModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if (role != Qt::DisplayRole)
if (role != Qt::DisplayRole) {
return QVariant();
if (orientation != Qt::Horizontal)
}
if (orientation != Qt::Horizontal) {
return QVariant();
}
switch (section) {
case NameColumn:
return QString(tr("Name"));
@ -81,21 +84,24 @@ QVariant CardDatabaseModel::headerData(int section, Qt::Orientation orientation,
void CardDatabaseModel::cardInfoChanged(CardInfoPtr card)
{
const int row = cardList.indexOf(card);
if (row == -1)
if (row == -1) {
return;
}
emit dataChanged(index(row, 0), index(row, CARDDBMODEL_COLUMNS - 1));
}
bool CardDatabaseModel::checkCardHasAtLeastOneEnabledSet(CardInfoPtr card)
{
if (!showOnlyCardsFromEnabledSets)
if (!showOnlyCardsFromEnabledSets) {
return true;
}
for (const auto &printings : card->getSets()) {
for (const auto &printing : printings) {
if (printing.getSet()->getEnabled())
if (printing.getSet()->getEnabled()) {
return true;
}
}
}