mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-14 19:18:55 -07:00
Reimplemented PictureLoader as a singleton
* Removed remaining picture handling from card database and cardinfo * removed the “noCard object” hack
This commit is contained in:
parent
8125358052
commit
f6c7f3355f
20 changed files with 654 additions and 704 deletions
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include "carditem.h"
|
||||
#include "carddatabase.h"
|
||||
#include "pictureloader.h"
|
||||
#include "main.h"
|
||||
|
||||
CardInfoPicture::CardInfoPicture(QWidget *parent)
|
||||
|
|
@ -21,7 +22,8 @@ void CardInfoPicture::setCard(CardInfo *card)
|
|||
if (info)
|
||||
disconnect(info, 0, this, 0);
|
||||
info = card;
|
||||
connect(info, SIGNAL(pixmapUpdated()), this, SLOT(updatePixmap()));
|
||||
if(info)
|
||||
connect(info, SIGNAL(pixmapUpdated()), this, SLOT(updatePixmap()));
|
||||
|
||||
updatePixmap();
|
||||
}
|
||||
|
|
@ -40,13 +42,13 @@ void CardInfoPicture::updatePixmap()
|
|||
void CardInfoPicture::loadPixmap()
|
||||
{
|
||||
if(info)
|
||||
info->getPixmap(size(), resizedPixmap);
|
||||
PictureLoader::getPixmap(resizedPixmap, info, size());
|
||||
else
|
||||
resizedPixmap = QPixmap();
|
||||
|
||||
|
||||
if (resizedPixmap.isNull())
|
||||
db->getCard()->getPixmap(size(), resizedPixmap);
|
||||
PictureLoader::getPixmap(resizedPixmap, db->getCard(), size());
|
||||
}
|
||||
|
||||
void CardInfoPicture::paintEvent(QPaintEvent *)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue