X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcore%2Fcorehighlightrulemanager.h;h=e8ae401483de1fd5b593c88cb7477f93ba3efa1f;hb=db00831bca59a012242d1ad5fac52a20c6cd2956;hp=4daf0168e2a4ef66db9cbf41b503b383c68db215;hpb=68878dc8366f2f4a0afe132847aad9a51a80cdbf;p=quassel.git diff --git a/src/core/corehighlightrulemanager.h b/src/core/corehighlightrulemanager.h index 4daf0168..e8ae4014 100644 --- a/src/core/corehighlightrulemanager.h +++ b/src/core/corehighlightrulemanager.h @@ -25,30 +25,48 @@ class CoreSession; struct RawMessage; +/** + * Core-side specialization for HighlightRuleManager. + * + * Adds the ability to load/save the settings from/to the database. + */ class CoreHighlightRuleManager : public HighlightRuleManager { Q_OBJECT - SYNCABLE_OBJECT using HighlightRuleManager::match; public: - explicit CoreHighlightRuleManager(CoreSession *parent); + /** + * Constructor. + * + * @param[in] session Pointer to the parent CoreSession (takes ownership) + */ + explicit CoreHighlightRuleManager(CoreSession* session); - inline virtual const QMetaObject *syncMetaObject() const { return &HighlightRuleManager::staticMetaObject; } - - bool match(const RawMessage &msg, const QString ¤tNick, const QStringList &identityNicks); + bool match(const RawMessage& msg, const QString& currentNick, const QStringList& identityNicks); public slots: - virtual inline void requestToggleHighlightRule(const QString &highlightRule) { toggleHighlightRule(highlightRule); } - virtual inline void requestRemoveHighlightRule(const QString &highlightRule) { removeHighlightRule(highlightRule); } - virtual inline void requestAddHighlightRule(const QString &name, bool isRegEx, bool isCaseSensitive, bool isEnabled, - bool isInverse, const QString &sender, const QString &chanName) + inline void requestToggleHighlightRule(int highlightRule) override { toggleHighlightRule(highlightRule); } + inline void requestRemoveHighlightRule(int highlightRule) override { removeHighlightRule(highlightRule); } + inline void requestAddHighlightRule(int id, + const QString& name, + bool isRegEx, + bool isCaseSensitive, + bool isEnabled, + bool isInverse, + const QString& sender, + const QString& chanName) override { - addHighlightRule(name, isRegEx, isCaseSensitive, isEnabled, isInverse, sender, chanName); + addHighlightRule(id, name, isRegEx, isCaseSensitive, isEnabled, isInverse, sender, chanName); } - private slots: - void save() const; + /** + * Saves the config to the database. + */ + void save(); + +private: + CoreSession* _coreSession{nullptr}; ///< Pointer to the parent CoreSession };