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:
ctrlaltca 2018-01-27 10:41:32 +01:00 committed by GitHub
parent 8dbdd24c8e
commit b29bd9e070
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
272 changed files with 13378 additions and 9535 deletions

View file

@ -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);