modernize: Reformat ALL the source... again!
[quassel.git] / src / common / nickhighlightmatcher.h
index ec4df0d..b6dc1e7 100644 (file)
@@ -36,10 +36,11 @@ class COMMON_EXPORT NickHighlightMatcher
 {
 public:
     /// Nickname highlighting mode
-    enum class HighlightNickType {
-        NoNick = 0x00,      ///< Don't match any nickname
-        CurrentNick = 0x01, ///< Match the current nickname
-        AllNicks = 0x02     ///< Match all configured nicknames in the chosen identity
+    enum class HighlightNickType
+    {
+        NoNick = 0x00,       ///< Don't match any nickname
+        CurrentNick = 0x01,  ///< Match the current nickname
+        AllNicks = 0x02      ///< Match all configured nicknames in the chosen identity
     };
     // NOTE: Keep this in sync with HighlightRuleManager::HighlightNickType and
     // NotificationSettings::HighlightNickType!
@@ -56,8 +57,9 @@ public:
      * @param isCaseSensitive  If true, nick matching is case-sensitive, otherwise case-insensitive
      */
     NickHighlightMatcher(HighlightNickType highlightMode, bool isCaseSensitive)
-        : _highlightMode(highlightMode),
-          _isCaseSensitive(isCaseSensitive) {}
+        : _highlightMode(highlightMode)
+        , _isCaseSensitive(isCaseSensitive)
+    {}
 
     /**
      * Gets the nickname highlighting policy
@@ -71,7 +73,8 @@ public:
      *
      * @param highlightMode Nickname highlighting mode
      */
-    void setHighlightMode(HighlightNickType highlightMode) {
+    void setHighlightMode(HighlightNickType highlightMode)
+    {
         if (_highlightMode != highlightMode) {
             _highlightMode = highlightMode;
             invalidateNickCache();
@@ -90,7 +93,8 @@ public:
      *
      * @param isCaseSensitive If true, nick matching is case-sensitive, otherwise case-insensitive
      */
-    void setCaseSensitive(bool isCaseSensitive) {
+    void setCaseSensitive(bool isCaseSensitive)
+    {
         if (_isCaseSensitive != isCaseSensitive) {
             _isCaseSensitive = isCaseSensitive;
             invalidateNickCache();
@@ -108,8 +112,7 @@ public:
      * @param identityNicks  All nicknames configured for the current identity
      * @return True if match found, otherwise false
      */
-    bool match(const QString &string, const NetworkId &netId, const QString &currentNick,
-               const QStringList &identityNicks) const;
+    bool match(const QString& string, const NetworkId& netId, const QString& currentNick, const QStringList& identityNicks) const;
 
 public slots:
     /**
@@ -117,7 +120,8 @@ public slots:
      *
      * @param netId Network ID of source network
      */
-    void removeNetwork(const NetworkId &netId) {
+    void removeNetwork(const NetworkId& netId)
+    {
         // Remove the network from the cache list
         if (_nickMatchCache.remove(netId) > 0) {
             qDebug() << "Cleared nickname matching cache for removed network ID" << netId;
@@ -125,7 +129,8 @@ public slots:
     }
 
 private:
-    struct NickMatchCache {
+    struct NickMatchCache
+    {
         // These represent internal cache and should be safe to mutate in 'const' functions
         QString nickCurrent = {};        ///< Last cached current nick
         QStringList identityNicks = {};  ///< Last cached identity nicks
@@ -139,15 +144,15 @@ private:
      * @param currentNick    Current nickname
      * @param identityNicks  All nicknames configured for the current identity
      */
-    void determineExpressions(const NetworkId &netId, const QString &currentNick,
-                              const QStringList &identityNicks) const;
+    void determineExpressions(const NetworkId& netId, const QString& currentNick, const QStringList& identityNicks) const;
 
     /**
      * Invalidate all nickname match caches
      *
      * Use this after changing global configuration.
      */
-    inline void invalidateNickCache() {
+    inline void invalidateNickCache()
+    {
         // Mark all as invalid
         if (_nickMatchCache.size() > 0) {
             _nickMatchCache.clear();
@@ -161,6 +166,5 @@ private:
     bool _isCaseSensitive = false;  ///< If true, match nicknames with exact case
 
     // These represent internal cache and should be safe to mutate in 'const' functions
-    mutable QHash<NetworkId, NickMatchCache> _nickMatchCache; ///< Per-network nick matching cache
-
+    mutable QHash<NetworkId, NickMatchCache> _nickMatchCache;  ///< Per-network nick matching cache
 };