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,61 +1,64 @@
#ifndef LOGGER_H
#define LOGGER_H
#include <QTextStream>
#include <QFile>
#include <QVector>
#include <QString>
#include <QMutex>
#include <QString>
#include <QTextStream>
#include <QVector>
#if defined(Q_PROCESSOR_X86_32)
#define BUILD_ARCHITECTURE "32-bit"
#define BUILD_ARCHITECTURE "32-bit"
#elif defined(Q_PROCESSOR_X86_64)
#define BUILD_ARCHITECTURE "64-bit"
#define BUILD_ARCHITECTURE "64-bit"
#elif defined(Q_PROCESSOR_ARM)
#define BUILD_ARCHITECTURE "ARM"
#define BUILD_ARCHITECTURE "ARM"
#else
#define BUILD_ARCHITECTURE "unknown"
#define BUILD_ARCHITECTURE "unknown"
#endif
class Logger : public QObject
{
Q_OBJECT
public:
static Logger& getInstance()
{
static Logger instance;
return instance;
}
public:
static Logger &getInstance()
{
static Logger instance;
return instance;
}
void logToFile(bool enabled);
void log(QtMsgType type, const QMessageLogContext &ctx, const QString message);
QString getClientVersion();
QString getClientOperatingSystem();
QString getSystemArchitecture();
QList<QString> getLogBuffer() { return logBuffer; }
void logToFile(bool enabled);
void log(QtMsgType type, const QMessageLogContext &ctx, const QString message);
QString getClientVersion();
QString getClientOperatingSystem();
QString getSystemArchitecture();
QList<QString> getLogBuffer()
{
return logBuffer;
}
private:
Logger();
~Logger();
// Singleton - Don't implement copy constructor and assign operator
Logger(Logger const&);
void operator=(Logger const&);
private:
Logger();
~Logger();
// Singleton - Don't implement copy constructor and assign operator
Logger(Logger const &);
void operator=(Logger const &);
bool logToFileEnabled;
QTextStream fileStream;
QFile fileHandle;
QList<QString> logBuffer;
QMutex mutex;
bool logToFileEnabled;
QTextStream fileStream;
QFile fileHandle;
QList<QString> logBuffer;
QMutex mutex;
protected:
void openLogfileSession();
void closeLogfileSession();
protected:
void openLogfileSession();
void closeLogfileSession();
protected slots:
void internalLog(const QString message);
protected slots:
void internalLog(const QString message);
signals:
void logEntryAdded(QString message);
signals:
void logEntryAdded(QString message);
};
#endif