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
cf313d5a
Commit
cf313d5a
authored
Apr 15, 2015
by
poixen
Browse files
Merge pull request #968 from poixen/simple_search
Removed check
parents
2f96cf20
2e5ecd84
Changes
1
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/carddatabasemodel.cpp
View file @
cf313d5a
...
@@ -125,13 +125,13 @@ bool CardDatabaseDisplayModel::lessThan(const QModelIndex &left, const QModelInd
...
@@ -125,13 +125,13 @@ bool CardDatabaseDisplayModel::lessThan(const QModelIndex &left, const QModelInd
if
(
!
cardName
.
isEmpty
())
if
(
!
cardName
.
isEmpty
())
{
{
if
(
leftString
.
compare
(
cardName
,
Qt
::
CaseInsensitive
)
==
0
)
{
// exact match should be at top
// exact match should be at top
if
(
leftString
.
compare
(
cardName
,
Qt
::
CaseInsensitive
)
==
0
)
return
true
;
return
true
;
}
if
(
rightString
.
compare
(
cardName
,
Qt
::
CaseInsensitive
)
==
0
)
{
// exact match should be at top
// exact match should be at top
if
(
rightString
.
compare
(
cardName
,
Qt
::
CaseInsensitive
)
==
0
)
return
false
;
return
false
;
}
bool
isLeftType2
=
leftString
.
startsWith
(
cardName
,
Qt
::
CaseInsensitive
);
bool
isLeftType2
=
leftString
.
startsWith
(
cardName
,
Qt
::
CaseInsensitive
);
bool
isRightType2
=
rightString
.
startsWith
(
cardName
,
Qt
::
CaseInsensitive
);
bool
isRightType2
=
rightString
.
startsWith
(
cardName
,
Qt
::
CaseInsensitive
);
...
@@ -141,7 +141,6 @@ bool CardDatabaseDisplayModel::lessThan(const QModelIndex &left, const QModelInd
...
@@ -141,7 +141,6 @@ bool CardDatabaseDisplayModel::lessThan(const QModelIndex &left, const QModelInd
return
false
;
return
false
;
}
}
return
QString
::
localeAwareCompare
(
leftString
,
rightString
)
<
0
;
return
QString
::
localeAwareCompare
(
leftString
,
rightString
)
<
0
;
}
}
bool
CardDatabaseDisplayModel
::
filterAcceptsRow
(
int
sourceRow
,
const
QModelIndex
&
/*sourceParent*/
)
const
bool
CardDatabaseDisplayModel
::
filterAcceptsRow
(
int
sourceRow
,
const
QModelIndex
&
/*sourceParent*/
)
const
...
@@ -151,13 +150,12 @@ bool CardDatabaseDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex
...
@@ -151,13 +150,12 @@ bool CardDatabaseDisplayModel::filterAcceptsRow(int sourceRow, const QModelIndex
if
(((
isToken
==
ShowTrue
)
&&
!
info
->
getIsToken
())
||
((
isToken
==
ShowFalse
)
&&
info
->
getIsToken
()))
if
(((
isToken
==
ShowTrue
)
&&
!
info
->
getIsToken
())
||
((
isToken
==
ShowFalse
)
&&
info
->
getIsToken
()))
return
false
;
return
false
;
if
(
!
cardName
.
isEmpty
())
if
(
!
CardInfo
::
simplifyName
(
info
->
getName
()).
contains
(
cardName
,
Qt
::
CaseInsensitive
))
if
(
!
CardInfo
::
simplifyName
(
info
->
getName
()).
contains
(
cardName
,
Qt
::
CaseInsensitive
))
return
false
;
return
false
;
if
(
!
cardNameSet
.
isEmpty
())
if
(
!
cardNameSet
.
isEmpty
())
if
(
!
cardNameSet
.
contains
(
info
->
getName
()))
if
(
!
cardNameSet
.
contains
(
info
->
getName
()))
return
false
;
return
false
;
if
(
filterTree
!=
NULL
)
if
(
filterTree
!=
NULL
)
return
filterTree
->
acceptsCard
(
info
);
return
filterTree
->
acceptsCard
(
info
);
...
...
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