diff options
author | TheKodeToad <TheKodeToad@proton.me> | 2023-08-16 20:46:16 +0100 |
---|---|---|
committer | TheKodeToad <TheKodeToad@proton.me> | 2023-08-16 22:23:38 +0100 |
commit | 3e2733d840d24ce4f46b49bca0b8656d4d6e3d87 (patch) | |
tree | 386113207514b8071b0122b318c10439259ca83c /launcher/launch/LogModel.h | |
parent | 57430fd189aed592a170d597de61b3acabaaa43d (diff) | |
parent | c88088c91a92a371a9bc2b7384c2897157772b7e (diff) | |
download | PrismLauncher-3e2733d840d24ce4f46b49bca0b8656d4d6e3d87.tar.gz PrismLauncher-3e2733d840d24ce4f46b49bca0b8656d4d6e3d87.tar.bz2 PrismLauncher-3e2733d840d24ce4f46b49bca0b8656d4d6e3d87.zip |
Merge branch 'develop' into better-launch
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
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) }; |