X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fignorelistmanager.h;h=79acff65d7f5a370b62dea74517f7d1b01cb07fc;hp=baf3cc103112ef61b54419d9cfa5329cb4e7f150;hb=8582c2ad5708a1972c85bea1cf8d81ad3ece4814;hpb=6fd69e84e6c395a108e6b2620c6428907b7d7efd diff --git a/src/common/ignorelistmanager.h b/src/common/ignorelistmanager.h index baf3cc10..79acff65 100644 --- a/src/common/ignorelistmanager.h +++ b/src/common/ignorelistmanager.h @@ -18,24 +18,26 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef IGNORELISTMANAGER_H -#define IGNORELISTMANAGER_H +#pragma once + +#include "common-export.h" -#include #include #include #include +#include #include "expressionmatch.h" #include "message.h" #include "syncableobject.h" -class IgnoreListManager : public SyncableObject +class COMMON_EXPORT IgnoreListManager : public SyncableObject { + Q_OBJECT SYNCABLE_OBJECT - Q_OBJECT + public: - inline IgnoreListManager(QObject *parent = 0) : SyncableObject(parent) { setAllowClientUpdates(true); } + inline IgnoreListManager(QObject *parent = nullptr) : SyncableObject(parent) { setAllowClientUpdates(true); } IgnoreListManager &operator=(const IgnoreListManager &other); enum IgnoreType { @@ -59,12 +61,12 @@ public: /** * Individual ignore list rule */ - class IgnoreListItem { + class COMMON_EXPORT IgnoreListItem { public: /** * Construct an empty ignore rule */ - IgnoreListItem() {} + IgnoreListItem() = default; /** * Construct an ignore rule with the given parameters @@ -80,11 +82,11 @@ public: * @param scopeRule String representing a scope rule expression to match * @param isEnabled True if enabled, otherwise false */ - IgnoreListItem(IgnoreType type, const QString &contents, bool isRegEx, - StrictnessType strictness, ScopeType scope, const QString &scopeRule, + IgnoreListItem(IgnoreType type, QString contents, bool isRegEx, + StrictnessType strictness, ScopeType scope, QString scopeRule, bool isEnabled) - : _contents(contents), _isRegEx(isRegEx), _strictness(strictness), - _scope(scope), _scopeRule(scopeRule), _isEnabled(isEnabled) + : _contents(std::move(contents)), _isRegEx(isRegEx), _strictness(strictness), + _scope(scope), _scopeRule(std::move(scopeRule)), _isEnabled(isEnabled) { // Allow passing empty "contents" as they can happen when editing an ignore rule @@ -332,7 +334,7 @@ public: mutable ExpressionMatch _ctcpSenderMatch = {}; ///< Expression match cache for CTCP nick }; - typedef QList IgnoreList; + using IgnoreList = QList; int indexOf(const QString &ignore) const; inline bool contains(const QString &ignore) const { return indexOf(ignore) != -1; } @@ -406,6 +408,3 @@ signals: private: IgnoreList _ignoreList; }; - - -#endif // IGNORELISTMANAGER_H