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
757795f7
Commit
757795f7
authored
Mar 30, 2015
by
Fabio Bas
Browse files
Deck editor: skip unnecessary card name comparison when no search term is defined
parent
b5b7ad89
Changes
1
Show whitespace changes
Inline
Side-by-side
cockatrice/src/carddatabasemodel.cpp
View file @
757795f7
...
...
@@ -123,6 +123,8 @@ bool CardDatabaseDisplayModel::lessThan(const QModelIndex &left, const QModelInd
QString
leftString
=
sourceModel
()
->
data
(
left
).
toString
();
QString
rightString
=
sourceModel
()
->
data
(
right
).
toString
();
if
(
!
cardName
.
isEmpty
())
{
if
(
leftString
.
compare
(
cardName
,
Qt
::
CaseInsensitive
)
==
0
)
{
// exact match should be at top
return
true
;
}
...
...
@@ -137,7 +139,7 @@ bool CardDatabaseDisplayModel::lessThan(const QModelIndex &left, const QModelInd
return
true
;
if
(
isRightType2
&&
!
isLeftType2
)
return
false
;
}
return
QString
::
localeAwareCompare
(
leftString
,
rightString
)
<
0
;
}
...
...
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