Display and update message processing progress
[quassel.git] / src / qtui / qtuimessageprocessor.h
index cfbc139..553d580 100644 (file)
@@ -21,6 +21,7 @@
 #ifndef QTUIMESSAGEPROCESSOR_H_
 #define QTUIMESSAGEPROCESSOR_H_
 
 #ifndef QTUIMESSAGEPROCESSOR_H_
 #define QTUIMESSAGEPROCESSOR_H_
 
+#include <QTime>
 #include <QTimer>
 
 #include "abstractmessageprocessor.h"
 #include <QTimer>
 
 #include "abstractmessageprocessor.h"
@@ -35,9 +36,12 @@ class QtUiMessageProcessor : public AbstractMessageProcessor {
     };
 
     QtUiMessageProcessor(QObject *parent);
     };
 
     QtUiMessageProcessor(QObject *parent);
+
     inline bool isProcessing() const { return _processing; }
     inline Mode processMode() const { return _processMode; }
 
     inline bool isProcessing() const { return _processing; }
     inline Mode processMode() const { return _processMode; }
 
+    void reset();
+
   public slots:
     void process(Message &msg);
     void process(QList<Message> &msgs);
   public slots:
     void process(Message &msg);
     void process(QList<Message> &msgs);
@@ -48,12 +52,15 @@ class QtUiMessageProcessor : public AbstractMessageProcessor {
   private:
     void checkForHighlight(Message &msg);
     void startProcessing();
   private:
     void checkForHighlight(Message &msg);
     void startProcessing();
+    void updateProgress(bool start = false);
 
     QList<QList<Message> > _processQueue;
     QList<Message> _currentBatch;
     QTimer _processTimer;
     bool _processing;
     Mode _processMode;
 
     QList<QList<Message> > _processQueue;
     QList<Message> _currentBatch;
     QTimer _processTimer;
     bool _processing;
     Mode _processMode;
+    int _msgsProcessed, _msgCount;
+    QTime _progressTimer;
 };
 
 #endif
 };
 
 #endif