mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-26 16:43:55 -07:00
cleaned up PictureLoader thread
This commit is contained in:
parent
b0378544c4
commit
2259204890
2 changed files with 25 additions and 63 deletions
|
|
@ -71,7 +71,8 @@ private:
|
|||
bool picDownload, downloadRunning, loadQueueRunning;
|
||||
void startNextPicDownload();
|
||||
public:
|
||||
PictureLoader(QObject *parent = 0);
|
||||
PictureLoader(const QString &__picsPath, bool _picDownload, QObject *parent = 0);
|
||||
~PictureLoader();
|
||||
void setPicsPath(const QString &path);
|
||||
void setPicDownload(bool _picDownload);
|
||||
void loadImage(CardInfo *card, bool stripped);
|
||||
|
|
@ -84,24 +85,6 @@ signals:
|
|||
void imageLoaded(CardInfo *card, const QImage &image);
|
||||
};
|
||||
|
||||
class PictureLoadingThread : public QThread {
|
||||
Q_OBJECT
|
||||
private:
|
||||
QString picsPath;
|
||||
bool picDownload;
|
||||
PictureLoader *pictureLoader;
|
||||
QWaitCondition initWaitCondition;
|
||||
protected:
|
||||
void run();
|
||||
public:
|
||||
PictureLoadingThread(const QString &_picsPath, bool _picDownload, QObject *parent);
|
||||
~PictureLoadingThread();
|
||||
PictureLoader *getPictureLoader() const { return pictureLoader; }
|
||||
void waitForInit();
|
||||
signals:
|
||||
void imageLoaded(CardInfo *card, const QImage &image);
|
||||
};
|
||||
|
||||
class CardInfo : public QObject {
|
||||
Q_OBJECT
|
||||
private:
|
||||
|
|
@ -178,7 +161,9 @@ protected:
|
|||
QHash<QString, CardSet *> setHash;
|
||||
bool loadSuccess;
|
||||
CardInfo *noCard;
|
||||
PictureLoadingThread *loadingThread;
|
||||
|
||||
QThread *pictureLoaderThread;
|
||||
PictureLoader *pictureLoader;
|
||||
private:
|
||||
void loadCardsFromXml(QXmlStreamReader &xml);
|
||||
void loadSetsFromXml(QXmlStreamReader &xml);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue