-void QtUiMessageProcessor::processMessages(QList<Message> &msgs) {
- foreach(Message msg, msgs) {
- checkForHighlight(msg);
- Client::messageModel()->insertMessage(msg);
+void QtUiMessageProcessor::startProcessing() {
+ if(processMode() == TimerBased) {
+ if(_currentBatch.isEmpty() && _processQueue.isEmpty()) return;
+ _processing = true;
+ if(!_processTimer.isActive()) _processTimer.start();
+ }
+}
+
+void QtUiMessageProcessor::processNextMessage() {
+ if(_currentBatch.isEmpty()) {
+ if(_processQueue.isEmpty()) {
+ _processTimer.stop();
+ _processing = false;
+ return;
+ }
+ _currentBatch = _processQueue.takeFirst();