Merge pull request #1292 from ctrlaltca/fix_compile_debug

fix compilation with gcc in paranoic mode
This commit is contained in:
Zach 2015-07-25 22:37:18 -07:00
commit 387137fbc7
2 changed files with 3 additions and 2 deletions

View file

@ -241,7 +241,7 @@ QSizeF DeckViewCardContainer::calculateBoundingRect(const QList<QPair<int, int>
return QSizeF(getCardTypeTextWidth() + totalWidth, totalHeight + separatorY + paddingY); return QSizeF(getCardTypeTextWidth() + totalWidth, totalHeight + separatorY + paddingY);
} }
bool sortCardsByName(DeckViewCard * c1, DeckViewCard * c2) bool DeckViewCardContainer::sortCardsByName(DeckViewCard * c1, DeckViewCard * c2)
{ {
if (c1 && c2) if (c1 && c2)
return c1->getName() < c2->getName(); return c1->getName() < c2->getName();
@ -264,7 +264,7 @@ void DeckViewCardContainer::rearrangeItems(const QList<QPair<int, int> > &rowsAn
QList<QString> cardTypeList = cardsByType.uniqueKeys(); QList<QString> cardTypeList = cardsByType.uniqueKeys();
QList<DeckViewCard *> row = cardsByType.values(cardTypeList[i]); 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) { for (int j = 0; j < row.size(); ++j) {
DeckViewCard *card = row[j]; DeckViewCard *card = row[j];
card->setPos(x + (j % tempCols) * CARD_WIDTH, yUntilNow + (j / tempCols) * CARD_HEIGHT); card->setPos(x + (j % tempCols) * CARD_WIDTH, yUntilNow + (j / tempCols) * CARD_HEIGHT);

View file

@ -46,6 +46,7 @@ class DeckViewCardContainer : public QGraphicsItem {
private: private:
static const int separatorY = 20; static const int separatorY = 20;
static const int paddingY = 10; static const int paddingY = 10;
static bool sortCardsByName(DeckViewCard * c1, DeckViewCard * c2);
QString name; QString name;
QList<DeckViewCard *> cards; QList<DeckViewCard *> cards;