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
387137fb
Commit
387137fb
authored
Jul 25, 2015
by
Zach
Browse files
Merge pull request #1292 from ctrlaltca/fix_compile_debug
fix compilation with gcc in paranoic mode
parents
f3ee1eac
119871d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/deckview.cpp
View file @
387137fb
...
...
@@ -241,7 +241,7 @@ QSizeF DeckViewCardContainer::calculateBoundingRect(const QList<QPair<int, int>
return
QSizeF
(
getCardTypeTextWidth
()
+
totalWidth
,
totalHeight
+
separatorY
+
paddingY
);
}
bool
sortCardsByName
(
DeckViewCard
*
c1
,
DeckViewCard
*
c2
)
bool
DeckViewCardContainer
::
sortCardsByName
(
DeckViewCard
*
c1
,
DeckViewCard
*
c2
)
{
if
(
c1
&&
c2
)
return
c1
->
getName
()
<
c2
->
getName
();
...
...
@@ -264,7 +264,7 @@ void DeckViewCardContainer::rearrangeItems(const QList<QPair<int, int> > &rowsAn
QList
<
QString
>
cardTypeList
=
cardsByType
.
uniqueKeys
();
QList
<
DeckViewCard
*>
row
=
cardsByType
.
values
(
cardTypeList
[
i
]);
qSort
(
row
.
begin
(),
row
.
end
(),
sortCardsByName
);
qSort
(
row
.
begin
(),
row
.
end
(),
DeckViewCardContainer
::
sortCardsByName
);
for
(
int
j
=
0
;
j
<
row
.
size
();
++
j
)
{
DeckViewCard
*
card
=
row
[
j
];
card
->
setPos
(
x
+
(
j
%
tempCols
)
*
CARD_WIDTH
,
yUntilNow
+
(
j
/
tempCols
)
*
CARD_HEIGHT
);
...
...
cockatrice/src/deckview.h
View file @
387137fb
...
...
@@ -46,6 +46,7 @@ class DeckViewCardContainer : public QGraphicsItem {
private:
static
const
int
separatorY
=
20
;
static
const
int
paddingY
=
10
;
static
bool
sortCardsByName
(
DeckViewCard
*
c1
,
DeckViewCard
*
c2
);
QString
name
;
QList
<
DeckViewCard
*>
cards
;
...
...
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