diff options
Diffstat (limited to 'launcher/launch/LogModel.h')
-rw-r--r-- | launcher/launch/LogModel.h | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/launcher/launch/LogModel.h b/launcher/launch/LogModel.h index 6aabc823..ba2e4054 100644 --- a/launcher/launch/LogModel.h +++ b/launcher/launch/LogModel.h @@ -4,14 +4,13 @@ #include <QString> #include "MessageLevel.h" -class LogModel : public QAbstractListModel -{ +class LogModel : public QAbstractListModel { Q_OBJECT -public: - explicit LogModel(QObject *parent = 0); + public: + explicit LogModel(QObject* parent = 0); - int rowCount(const QModelIndex &parent = QModelIndex()) const; - QVariant data(const QModelIndex &index, int role) const; + int rowCount(const QModelIndex& parent = QModelIndex()) const; + QVariant data(const QModelIndex& index, int role) const; void append(MessageLevel::Enum, QString line); void clear(); @@ -24,25 +23,21 @@ public: int getMaxLines(); void setMaxLines(int maxLines); void setStopOnOverflow(bool stop); - void setOverflowMessage(const QString & overflowMessage); + void setOverflowMessage(const QString& overflowMessage); void setLineWrap(bool state); bool wrapLines() const; - enum Roles - { - LevelRole = Qt::UserRole - }; + enum Roles { LevelRole = Qt::UserRole }; -private /* types */: - struct entry - { + private /* types */: + struct entry { MessageLevel::Enum level; QString line; }; -private: /* data */ - QVector <entry> m_content; + private: /* data */ + QVector<entry> m_content; int m_maxLines = 1000; // first line in the circular buffer int m_firstLine = 0; @@ -53,6 +48,6 @@ private: /* data */ bool m_suspended = false; bool m_lineWrap = true; -private: + private: Q_DISABLE_COPY(LogModel) }; |