mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-08 09:03:57 -07:00
Replace CardInfo* and Carset* with smart pointers (#3053)
* Replace CardInfo* and Carset* with smart pointers * fixes to help memory & c++11 stuff
This commit is contained in:
parent
3e418ba3c6
commit
517420cccb
37 changed files with 409 additions and 342 deletions
|
|
@ -36,21 +36,21 @@ public:
|
|||
{
|
||||
return db;
|
||||
}
|
||||
CardInfo *getCard(int index) const
|
||||
CardInfoPtr getCard(int index) const
|
||||
{
|
||||
return cardList[index];
|
||||
}
|
||||
|
||||
private:
|
||||
QList<CardInfo *> cardList;
|
||||
QList<CardInfoPtr> cardList;
|
||||
CardDatabase *db;
|
||||
bool showOnlyCardsFromEnabledSets;
|
||||
|
||||
inline bool checkCardHasAtLeastOneEnabledSet(CardInfo *card);
|
||||
inline bool checkCardHasAtLeastOneEnabledSet(CardInfoPtr card);
|
||||
private slots:
|
||||
void cardAdded(CardInfo *card);
|
||||
void cardRemoved(CardInfo *card);
|
||||
void cardInfoChanged(CardInfo *card);
|
||||
void cardAdded(CardInfoPtr card);
|
||||
void cardRemoved(CardInfoPtr card);
|
||||
void cardInfoChanged(CardInfoPtr card);
|
||||
void cardDatabaseEnabledSetsChanged();
|
||||
};
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ protected:
|
|||
bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
|
||||
static int lessThanNumerically(const QString &left, const QString &right);
|
||||
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
|
||||
bool rowMatchesCardName(CardInfo const *info) const;
|
||||
bool rowMatchesCardName(CardInfoPtr info) const;
|
||||
bool canFetchMore(const QModelIndex &parent) const;
|
||||
void fetchMore(const QModelIndex &parent);
|
||||
private slots:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue