summaryrefslogtreecommitdiff
path: root/src/logbuffer.h
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-05-04 14:50:01 +0200
committerTannin <devnull@localhost>2014-05-04 14:50:01 +0200
commit6fb36d6c028d4fe88043c764e42b54df9b06f48b (patch)
tree8c23cfc17447d217d91eb170cffa5a6372f003b1 /src/logbuffer.h
parentea1f959ad592c1f10c5c60908e01c220aed206a5 (diff)
- main window now has a small view displaying log messages
- mod list will now be highlighted when grouping is active is active - download tooltip now supports bbcode markup in the description - bbcode translator will now translate some named colors - algorithm for detection of mod order problems is now more sophisticated - exposed more functionality to python plugins - updated to qt 4.8.6 dlls - bugfix: plugin list wasn't - bugfix: state changes in mod list wasn't always reported - bugfix: loot client will now create necessary directory - bugfix: NCC sometimes used wrong source path for extracting - bugfix: removed noisy debug message
Diffstat (limited to 'src/logbuffer.h')
-rw-r--r--src/logbuffer.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/logbuffer.h b/src/logbuffer.h
index 68753996..caada1d9 100644
--- a/src/logbuffer.h
+++ b/src/logbuffer.h
@@ -23,10 +23,12 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <QObject>
#include <QMutex>
#include <QScopedPointer>
+#include <QStringListModel>
+#include <QTime>
#include <vector>
-class LogBuffer : public QObject
+class LogBuffer : public QAbstractItemModel
{
Q_OBJECT
@@ -42,12 +44,22 @@ public:
static void writeNow();
static void cleanQuit();
+ static LogBuffer *instance() { return s_Instance.data(); }
+
public:
virtual ~LogBuffer();
void logMessage(QtMsgType type, const QString &message);
+ // 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;
+
signals:
public slots:
@@ -64,6 +76,15 @@ private:
private:
+ struct Message {
+ QtMsgType type;
+ QTime time;
+ QString message;
+ QString toString() const;
+ };
+
+private:
+
static QScopedPointer<LogBuffer> s_Instance;
static QMutex s_Mutex;
@@ -71,7 +92,7 @@ private:
bool m_ShutDown;
QtMsgType m_MinMsgType;
unsigned int m_NumMessages;
- std::vector<QString> m_Messages;
+ std::vector<Message> m_Messages;
};