fixed crash that occurs when reloading the card database while deck editor or game is running

This commit is contained in:
Max-Wilhelm Bruker 2011-02-28 18:20:27 +01:00
parent b0656ffcea
commit 7a7b686e67
8 changed files with 31 additions and 3 deletions

View file

@ -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)
{