mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-01 11:03:54 -07:00
added automatic download of card pictures
This commit is contained in:
parent
5bb08be2a4
commit
12a151a0c3
2 changed files with 48 additions and 3 deletions
|
|
@ -7,6 +7,8 @@
|
|||
#include <QDataStream>
|
||||
#include <QList>
|
||||
#include <QXmlStreamReader>
|
||||
#include <QHttp>
|
||||
#include <QFile>
|
||||
|
||||
class CardDatabase;
|
||||
class CardInfo;
|
||||
|
|
@ -31,7 +33,8 @@ public:
|
|||
void sortByKey();
|
||||
};
|
||||
|
||||
class CardInfo {
|
||||
class CardInfo : QObject{
|
||||
Q_OBJECT
|
||||
private:
|
||||
CardDatabase *db;
|
||||
|
||||
|
|
@ -43,9 +46,14 @@ private:
|
|||
QString text;
|
||||
QStringList colors;
|
||||
QString picURL;
|
||||
QHttp http;
|
||||
QFile *newPic;
|
||||
int dlID;
|
||||
int tableRow;
|
||||
QPixmap *pixmap;
|
||||
QMap<int, QPixmap *> scaledPixmapCache;
|
||||
|
||||
void startDownload(QString, QString);
|
||||
public:
|
||||
CardInfo(CardDatabase *_db,
|
||||
const QString &_name = QString(),
|
||||
|
|
@ -75,6 +83,8 @@ public:
|
|||
QPixmap *getPixmap(QSize size);
|
||||
void clearPixmapCache();
|
||||
void updatePixmapCache();
|
||||
public slots:
|
||||
void picDownloadFinished(int, bool);
|
||||
};
|
||||
|
||||
class CardDatabase : public QObject {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue