X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fqtuimessageprocessor.h;h=64ae5a0583809660d3b321c48b169de6c9fbea5a;hp=53d4f0216db090f38a67a817187d68b2d6b25a6f;hb=f448828fb29f3d23d9306f777cd264a13fde0e9a;hpb=019a59ffca44ddc32fc6b16fd6cdcc8f3e1c93c6 diff --git a/src/qtui/qtuimessageprocessor.h b/src/qtui/qtuimessageprocessor.h index 53d4f021..64ae5a05 100644 --- a/src/qtui/qtuimessageprocessor.h +++ b/src/qtui/qtuimessageprocessor.h @@ -1,5 +1,5 @@ /*************************************************************************** -* Copyright (C) 2005-08 by the Quassel Project * +* Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -21,6 +21,7 @@ #ifndef QTUIMESSAGEPROCESSOR_H_ #define QTUIMESSAGEPROCESSOR_H_ +#include #include #include "abstractmessageprocessor.h" @@ -28,35 +29,54 @@ class QtUiMessageProcessor : public AbstractMessageProcessor { Q_OBJECT - public: - enum Mode { - TimerBased, - Concurrent - }; +public: + enum Mode { + TimerBased, + Concurrent + }; - 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(); + void reset(); - public slots: - void process(Message &msg); - void process(QList &msgs); +public slots: + void process(Message &msg); + void process(QList &msgs); - private slots: - void processNextMessage(); +private slots: + void processNextMessage(); + void nicksCaseSensitiveChanged(const QVariant &variant); + void highlightListChanged(const QVariant &variant); + void highlightNickChanged(const QVariant &variant); - private: - void checkForHighlight(Message &msg); - void startProcessing(); +private: + void checkForHighlight(Message &msg); + void startProcessing(); + void updateProgress(bool start = false); - QList > _processQueue; - QList _currentBatch; - QTimer _processTimer; - bool _processing; - Mode _processMode; + QList > _processQueue; + QList _currentBatch; + QTimer _processTimer; + bool _processing; + Mode _processMode; + int _msgsProcessed, _msgCount; + QTime _progressTimer; + + struct HighlightRule { + QString name; + bool isEnabled; + Qt::CaseSensitivity caseSensitive; + bool isRegExp; + inline HighlightRule(const QString &name, bool enabled, Qt::CaseSensitivity cs, bool regExp) + : name(name), isEnabled(enabled), caseSensitive(cs), isRegExp(regExp) {} + }; + + QList _highlightRules; + NotificationSettings::HighlightNickType _highlightNick; + bool _nicksCaseSensitive; }; #endif