From 5e5c9c07291f6b09623d31c92b1fb61c4ede576e Mon Sep 17 00:00:00 2001 From: Sandro Jäckel Date: Thu, 22 Feb 2018 16:54:34 +0100 Subject: Applied clang-format on source --- src/logbuffer.h | 78 ++++++++++++++++++++++++++------------------------------- 1 file changed, 35 insertions(+), 43 deletions(-) (limited to 'src/logbuffer.h') diff --git a/src/logbuffer.h b/src/logbuffer.h index 0cfecfa2..0a35e91a 100644 --- a/src/logbuffer.h +++ b/src/logbuffer.h @@ -20,76 +20,68 @@ along with Mod Organizer. If not, see . #ifndef LOGBUFFER_H #define LOGBUFFER_H -#include #include +#include #include #include #include #include - -class LogBuffer : public QAbstractItemModel -{ - Q_OBJECT +class LogBuffer : public QAbstractItemModel { + Q_OBJECT public: + static void init(int messageCount, QtMsgType minMsgType, const QString& outputFileName); + static void log(QtMsgType type, const QMessageLogContext& context, const QString& message); - static void init(int messageCount, QtMsgType minMsgType, const QString &outputFileName); - static void log(QtMsgType type, const QMessageLogContext &context, const QString &message); + static void writeNow(); + static void cleanQuit(); - static void writeNow(); - static void cleanQuit(); - - static LogBuffer *instance() { return s_Instance.data(); } + static LogBuffer* instance() { return s_Instance.data(); } public: + virtual ~LogBuffer(); - virtual ~LogBuffer(); - - void logMessage(QtMsgType type, const QString &message); + void logMessage(QtMsgType type, const QString& message); - // QAbstractItemModel interface + // QAbstractItemModel interface public: - QModelIndex index(int row, int column, const QModelIndex &parent) const; - QModelIndex parent(const QModelIndex &child) const; - int rowCount(const QModelIndex &parent) const; - int columnCount(const QModelIndex &parent) const; - QVariant data(const QModelIndex &index, int role) const; + QModelIndex index(int row, int column, const QModelIndex& parent) const; + QModelIndex parent(const QModelIndex& child) const; + int rowCount(const QModelIndex& parent) const; + int columnCount(const QModelIndex& parent) const; + QVariant data(const QModelIndex& index, int role) const; signals: public slots: private: + explicit LogBuffer(int messageCount, QtMsgType minMsgType, const QString& outputFileName); + LogBuffer(const LogBuffer& reference); // not implemented + LogBuffer& operator=(const LogBuffer& reference); // not implemented - explicit LogBuffer(int messageCount, QtMsgType minMsgType, const QString &outputFileName); - LogBuffer(const LogBuffer &reference); // not implemented - LogBuffer &operator=(const LogBuffer &reference); // not implemented + void write() const; - void write() const; - - static char msgTypeID(QtMsgType type); + static char msgTypeID(QtMsgType type); private: - - struct Message { - QtMsgType type; - QTime time; - QString message; - QString toString() const; - }; + struct Message { + QtMsgType type; + QTime time; + QString message; + QString toString() const; + }; private: - - static QScopedPointer s_Instance; - static QMutex s_Mutex; - - QString m_OutFileName; - bool m_ShutDown; - QtMsgType m_MinMsgType; - size_t m_NumMessages; - std::vector m_Messages; - + static QScopedPointer s_Instance; + static QMutex s_Mutex; + + QString m_OutFileName; + bool m_ShutDown; + QtMsgType m_MinMsgType; + size_t m_NumMessages; + std::vector m_Messages; }; #endif // LOGBUFFER_H -- cgit v1.3.1