projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Display and update message processing progress
[quassel.git]
/
src
/
qtui
/
qtuimessageprocessor.h
diff --git
a/src/qtui/qtuimessageprocessor.h
b/src/qtui/qtuimessageprocessor.h
index
161385b
..
553d580
100644
(file)
--- a/
src/qtui/qtuimessageprocessor.h
+++ b/
src/qtui/qtuimessageprocessor.h
@@
-21,21
+21,46
@@
#ifndef QTUIMESSAGEPROCESSOR_H_
#define QTUIMESSAGEPROCESSOR_H_
#ifndef QTUIMESSAGEPROCESSOR_H_
#define QTUIMESSAGEPROCESSOR_H_
+#include <QTime>
+#include <QTimer>
+
#include "abstractmessageprocessor.h"
class QtUiMessageProcessor : public AbstractMessageProcessor {
Q_OBJECT
public:
#include "abstractmessageprocessor.h"
class QtUiMessageProcessor : public AbstractMessageProcessor {
Q_OBJECT
public:
+ enum Mode {
+ TimerBased,
+ Concurrent
+ };
+
QtUiMessageProcessor(QObject *parent);
QtUiMessageProcessor(QObject *parent);
+ inline bool isProcessing() const { return _processing; }
+ inline Mode processMode() const { return _processMode; }
- private:
- void processMessage(Message &msg);
- void processMessages(QList<Message> &msgs);
+ void reset();
+ public slots:
+ void process(Message &msg);
+ void process(QList<Message> &msgs);
+
+ private slots:
+ void processNextMessage();
+
+ private:
void checkForHighlight(Message &msg);
void checkForHighlight(Message &msg);
+ void startProcessing();
+ void updateProgress(bool start = false);
+ QList<QList<Message> > _processQueue;
+ QList<Message> _currentBatch;
+ QTimer _processTimer;
+ bool _processing;
+ Mode _processMode;
+ int _msgsProcessed, _msgCount;
+ QTime _progressTimer;
};
#endif
};
#endif