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

@ -115,6 +115,7 @@ void CardInfoWidget::setCard(CardInfo *card)
disconnect(info, 0, this, 0);
info = card;
connect(info, SIGNAL(pixmapUpdated()), this, SLOT(updatePixmap()));
connect(info, SIGNAL(destroyed()), this, SLOT(clear()));
updatePixmap();
nameLabel2->setText(card->getName());
@ -134,6 +135,11 @@ void CardInfoWidget::setCard(AbstractCardItem *card)
setCard(card->getInfo());
}
void CardInfoWidget::clear()
{
setCard(db->getCard());
}
void CardInfoWidget::updatePixmap()
{
QPixmap *resizedPixmap = info->getPixmap(QSize(pixmapWidth, pixmapWidth * aspectRatio));