mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-09 15:54:47 -07:00
fixed crash that occurs when reloading the card database while deck editor or game is running
This commit is contained in:
parent
b0656ffcea
commit
7a7b686e67
8 changed files with 31 additions and 3 deletions
|
|
@ -3,6 +3,7 @@
|
|||
CardDatabaseModel::CardDatabaseModel(CardDatabase *_db, QObject *parent)
|
||||
: QAbstractListModel(parent), db(_db)
|
||||
{
|
||||
connect(db, SIGNAL(cardListChanged()), this, SLOT(updateCardList()));
|
||||
cardList = db->getCardList();
|
||||
}
|
||||
|
||||
|
|
@ -63,6 +64,12 @@ QVariant CardDatabaseModel::headerData(int section, Qt::Orientation orientation,
|
|||
}
|
||||
}
|
||||
|
||||
void CardDatabaseModel::updateCardList()
|
||||
{
|
||||
cardList = db->getCardList();
|
||||
reset();
|
||||
}
|
||||
|
||||
CardDatabaseDisplayModel::CardDatabaseDisplayModel(QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue