mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-04 04:23:55 -07:00
Run formatter on all our files (#6942)
This commit is contained in:
parent
b3c89167c5
commit
1d5d3f2d38
19 changed files with 153 additions and 81 deletions
|
|
@ -89,12 +89,15 @@ static inline QString toString(Type t)
|
|||
|
||||
static inline Type fromString(const QString &s)
|
||||
{
|
||||
if (s == "Main Type")
|
||||
if (s == "Main Type") {
|
||||
return MAIN_TYPE;
|
||||
if (s == "Mana Cost")
|
||||
}
|
||||
if (s == "Mana Cost") {
|
||||
return MANA_COST;
|
||||
if (s == "Colors")
|
||||
}
|
||||
if (s == "Colors") {
|
||||
return COLOR;
|
||||
}
|
||||
return MAIN_TYPE; // default
|
||||
}
|
||||
} // namespace DeckListModelGroupCriteria
|
||||
|
|
@ -427,8 +430,9 @@ private:
|
|||
|
||||
template <typename T> T getNode(const QModelIndex &index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
if (!index.isValid()) {
|
||||
return dynamic_cast<T>(root);
|
||||
}
|
||||
return dynamic_cast<T>(static_cast<AbstractDecklistNode *>(index.internalPointer()));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,25 +29,29 @@ bool DeckListSortFilterProxyModel::lessThan(const QModelIndex &left, const QMode
|
|||
QString ln = lNode->getName();
|
||||
QString rn = rNode->getName();
|
||||
int cmp = ln.localeAwareCompare(rn);
|
||||
if (cmp != 0)
|
||||
if (cmp != 0) {
|
||||
return cmp < 0;
|
||||
}
|
||||
} else if (crit == "cmc") {
|
||||
int lc = lInfo ? lInfo->getCmc().toInt() : 0;
|
||||
int rc = rInfo ? rInfo->getCmc().toInt() : 0;
|
||||
if (lc != rc)
|
||||
if (lc != rc) {
|
||||
return lc < rc;
|
||||
}
|
||||
} else if (crit == "colors") {
|
||||
QString lr = lInfo ? lInfo->getColors() : QString();
|
||||
QString rr = rInfo ? rInfo->getColors() : QString();
|
||||
int cmp = lr.localeAwareCompare(rr);
|
||||
if (cmp != 0)
|
||||
if (cmp != 0) {
|
||||
return cmp < 0;
|
||||
}
|
||||
} else if (crit == "maintype") {
|
||||
QString lr = lInfo ? lInfo->getMainCardType() : QString();
|
||||
QString rr = rInfo ? rInfo->getMainCardType() : QString();
|
||||
int cmp = lr.localeAwareCompare(rr);
|
||||
if (cmp != 0)
|
||||
if (cmp != 0) {
|
||||
return cmp < 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue