mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-03 12:03:55 -07:00
Clang-format (#3028)
* 1/3 Add .clang-format file and travis compilation check * 2/3 Run clang-format * 3/3 Fix compilation problems due to include reordering * 3bis/3 AfterControlStatement: false
This commit is contained in:
parent
8dbdd24c8e
commit
b29bd9e070
272 changed files with 13378 additions and 9535 deletions
|
|
@ -1,10 +1,10 @@
|
|||
#ifndef PICTURELOADER_H
|
||||
#define PICTURELOADER_H
|
||||
|
||||
#include <QMap>
|
||||
#include <QList>
|
||||
#include <QNetworkRequest>
|
||||
#include <QMap>
|
||||
#include <QMutex>
|
||||
#include <QNetworkRequest>
|
||||
|
||||
class CardInfo;
|
||||
class CardSet;
|
||||
|
|
@ -12,7 +12,8 @@ class QNetworkAccessManager;
|
|||
class QNetworkReply;
|
||||
class QThread;
|
||||
|
||||
class PictureToLoad {
|
||||
class PictureToLoad
|
||||
{
|
||||
private:
|
||||
class SetDownloadPriorityComparator;
|
||||
|
||||
|
|
@ -20,21 +21,27 @@ private:
|
|||
QList<CardSet *> sortedSets;
|
||||
int setIndex;
|
||||
bool hq;
|
||||
|
||||
public:
|
||||
PictureToLoad(CardInfo *_card = 0);
|
||||
CardInfo *getCard() const { return card; }
|
||||
CardInfo *getCard() const
|
||||
{
|
||||
return card;
|
||||
}
|
||||
CardSet *getCurrentSet() const;
|
||||
QString getSetName() const;
|
||||
bool nextSet();
|
||||
};
|
||||
|
||||
class PictureLoaderWorker : public QObject {
|
||||
Q_OBJECT
|
||||
class PictureLoaderWorker : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PictureLoaderWorker();
|
||||
~PictureLoaderWorker();
|
||||
|
||||
void enqueueImageLoad(CardInfo *card);
|
||||
|
||||
private:
|
||||
static QStringList md5Blacklist;
|
||||
|
||||
|
|
@ -49,7 +56,7 @@ private:
|
|||
bool picDownload, downloadRunning, loadQueueRunning;
|
||||
void startNextPicDownload();
|
||||
QString getPicUrl();
|
||||
bool cardImageExistsOnDisk(QString & setName, QString & correctedCardname);
|
||||
bool cardImageExistsOnDisk(QString &setName, QString &correctedCardname);
|
||||
bool imageIsBlackListed(const QByteArray &picData);
|
||||
private slots:
|
||||
void picDownloadFinished(QNetworkReply *reply);
|
||||
|
|
@ -64,22 +71,25 @@ signals:
|
|||
void imageLoaded(CardInfo *card, const QImage &image);
|
||||
};
|
||||
|
||||
class PictureLoader : public QObject {
|
||||
Q_OBJECT
|
||||
class PictureLoader : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static PictureLoader& getInstance()
|
||||
static PictureLoader &getInstance()
|
||||
{
|
||||
static PictureLoader instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
private:
|
||||
PictureLoader();
|
||||
~PictureLoader();
|
||||
// Singleton - Don't implement copy constructor and assign operator
|
||||
PictureLoader(PictureLoader const&);
|
||||
void operator=(PictureLoader const&);
|
||||
PictureLoader(PictureLoader const &);
|
||||
void operator=(PictureLoader const &);
|
||||
|
||||
PictureLoaderWorker *worker;
|
||||
|
||||
PictureLoaderWorker * worker;
|
||||
public:
|
||||
static void getPixmap(QPixmap &pixmap, CardInfo *card, QSize size);
|
||||
static void getCardBackPixmap(QPixmap &pixmap, QSize size);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue