Revert "Reimplemented PictureLoader as a singleton"

This commit is contained in:
Zach 2015-09-23 03:17:33 -04:00
parent 064c89ba5c
commit d5adec53a2
21 changed files with 705 additions and 657 deletions

View file

@ -9,7 +9,6 @@
#include "carddatabase.h"
#include "cardinfowidget.h"
#include "abstractcarditem.h"
#include "pictureloader.h"
#include "settingscache.h"
#include "main.h"
#include "gamescene.h"
@ -46,8 +45,7 @@ void AbstractCardItem::pixmapUpdated()
void AbstractCardItem::cardInfoUpdated()
{
info = db->getCard(name);
if(info)
connect(info, SIGNAL(pixmapUpdated()), this, SLOT(pixmapUpdated()));
connect(info, SIGNAL(pixmapUpdated()), this, SLOT(pixmapUpdated()));
}
void AbstractCardItem::setRealZValue(qreal _zValue)
@ -95,7 +93,7 @@ void AbstractCardItem::paintPicture(QPainter *painter, const QSizeF &translatedS
QPixmap translatedPixmap;
// don't even spend time trying to load the picture if our size is too small
if(translatedSize.width() > 10)
PictureLoader::getPixmap(translatedPixmap, imageSource, translatedSize.toSize());
imageSource->getPixmap(translatedSize.toSize(), translatedPixmap);
painter->save();
QColor bgColor = Qt::transparent;
@ -193,12 +191,10 @@ void AbstractCardItem::setName(const QString &_name)
return;
emit deleteCardInfoPopup(name);
if(info)
disconnect(info, 0, this, 0);
disconnect(info, 0, this, 0);
name = _name;
info = db->getCard(name);
if(info)
connect(info, SIGNAL(pixmapUpdated()), this, SLOT(pixmapUpdated()));
connect(info, SIGNAL(pixmapUpdated()), this, SLOT(pixmapUpdated()));
update();
}