Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
0b98d903
Commit
0b98d903
authored
Aug 27, 2010
by
Max-Wilhelm Bruker
Browse files
search function couldn't find colorless cards: fixed
parent
f9b0b4b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/carddatabase.cpp
View file @
0b98d903
...
...
@@ -511,8 +511,11 @@ QStringList CardDatabase::getAllColors() const
QHashIterator
<
QString
,
CardInfo
*>
cardIterator
(
cardHash
);
while
(
cardIterator
.
hasNext
())
{
const
QStringList
&
cardColors
=
cardIterator
.
next
().
value
()
->
getColors
();
for
(
int
i
=
0
;
i
<
cardColors
.
size
();
++
i
)
colors
.
insert
(
cardColors
[
i
]);
if
(
cardColors
.
isEmpty
())
colors
.
insert
(
"X"
);
else
for
(
int
i
=
0
;
i
<
cardColors
.
size
();
++
i
)
colors
.
insert
(
cardColors
[
i
]);
}
return
colors
.
toList
();
}
...
...
cockatrice/src/carddatabasemodel.cpp
View file @
0b98d903
...
...
@@ -87,7 +87,7 @@ bool CardDatabaseDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex
return
false
;
if
(
!
cardColors
.
isEmpty
())
if
(
QSet
<
QString
>::
fromList
(
info
->
getColors
()).
intersect
(
cardColors
).
isEmpty
())
if
(
QSet
<
QString
>::
fromList
(
info
->
getColors
()).
intersect
(
cardColors
).
isEmpty
()
&&
!
(
info
->
getColors
().
isEmpty
()
&&
cardColors
.
contains
(
"X"
))
)
return
false
;
if
(
!
cardTypes
.
isEmpty
())
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment