X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcorehighlightrulemanager.h;h=064852494116acf81b1bc217e3e08ddb107500b1;hp=09d7cbff7070b98a370cc9fbf74e72c32c34de0b;hb=c194ed5fb3d15e14b9364f9796d3521910dc72fe;hpb=71d3d0d705a853fa8fea3729e13dbddf52363417 diff --git a/src/core/corehighlightrulemanager.h b/src/core/corehighlightrulemanager.h index 09d7cbff..06485249 100644 --- a/src/core/corehighlightrulemanager.h +++ b/src/core/corehighlightrulemanager.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -25,30 +25,43 @@ 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); - - inline virtual const QMetaObject *syncMetaObject() const { return &HighlightRuleManager::staticMetaObject; } + /** + * Constructor. + * + * @param[in] session Pointer to the parent CoreSession (takes ownership) + */ + explicit CoreHighlightRuleManager(CoreSession *session); bool match(const RawMessage &msg, const QString ¤tNick, 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 };