mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
Style fix
This commit is contained in:
parent
286982350c
commit
f02f572dac
3 changed files with 15 additions and 11 deletions
|
|
@ -148,7 +148,8 @@ void VisualDatabaseDisplayColorFilterWidget::removeFilter(QChar color)
|
|||
|
||||
case FilterMode::Commander:
|
||||
removeFilters(filterModel, color, CardFilter::Attr::AttrColorIdentity);
|
||||
filterModel->addFilter(new CardFilter(color, CardFilter::Type::TypeAndNot, CardFilter::Attr::AttrColorIdentity));
|
||||
filterModel->addFilter(
|
||||
new CardFilter(color, CardFilter::Type::TypeAndNot, CardFilter::Attr::AttrColorIdentity));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -210,9 +211,7 @@ QList<QChar> VisualDatabaseDisplayColorFilterWidget::getActiveColors()
|
|||
void VisualDatabaseDisplayColorFilterWidget::syncWithFilterModel()
|
||||
{
|
||||
QList<const CardFilter *> allColorFilters = filterModel->getFiltersOfType(
|
||||
currentMode == FilterMode::Commander
|
||||
? CardFilter::Attr::AttrColorIdentity
|
||||
: CardFilter::Attr::AttrColor);
|
||||
currentMode == FilterMode::Commander ? CardFilter::Attr::AttrColorIdentity : CardFilter::Attr::AttrColor);
|
||||
|
||||
QList<ManaSymbolWidget *> manaSymbolWidgets = findChildren<ManaSymbolWidget *>();
|
||||
|
||||
|
|
@ -223,25 +222,30 @@ void VisualDatabaseDisplayColorFilterWidget::syncWithFilterModel()
|
|||
if (symbol == filter->term()) {
|
||||
switch (currentMode) {
|
||||
case FilterMode::ExactMatch:
|
||||
if (filter->type() == CardFilter::Type::TypeAnd)
|
||||
if (filter->type() == CardFilter::Type::TypeAnd) {
|
||||
found = true;
|
||||
}
|
||||
break;
|
||||
case FilterMode::Includes:
|
||||
case FilterMode::IncludeExclude:
|
||||
if (filter->type() == CardFilter::Type::TypeOr)
|
||||
if (filter->type() == CardFilter::Type::TypeOr) {
|
||||
found = true;
|
||||
}
|
||||
break;
|
||||
case FilterMode::Excludes:
|
||||
if (filter->type() == CardFilter::Type::TypeAndNot)
|
||||
if (filter->type() == CardFilter::Type::TypeAndNot) {
|
||||
found = true;
|
||||
}
|
||||
break;
|
||||
case FilterMode::Commander:
|
||||
if (filter->type() == CardFilter::Type::TypeAndNot)
|
||||
if (filter->type() == CardFilter::Type::TypeAndNot) {
|
||||
found = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (found)
|
||||
if (found) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ private:
|
|||
enum Attr a;
|
||||
|
||||
public:
|
||||
CardFilter(QString const &term, Type type, Attr attr) : trm(term), t(type), a(attr)
|
||||
CardFilter(const QString &term, Type type, Attr attr) : trm(term), t(type), a(attr)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ bool FilterItem::acceptSubType(const CardInfoPtr info) const
|
|||
return typeParts.size() > 1 && typeParts[1].contains(term, Qt::CaseInsensitive);
|
||||
}
|
||||
|
||||
static bool matchesColor(QString const &term, QString const &colors) {
|
||||
static bool matchesColor(const QString &term, const QString &colors) {
|
||||
QString converted_term = term.trimmed().toLower();
|
||||
|
||||
converted_term.replace("green", "g");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue