modernize: Prefer default member init over ctor init
[quassel.git] / src / core / ctcpparser.h
index d3f50c9..7fd2a83 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
 /***************************************************************************
- *   Copyright (C) 2005-2013 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  *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -22,6 +22,7 @@
 #define CTCPPARSER_H
 
 #include <QUuid>
 #define CTCPPARSER_H
 
 #include <QUuid>
+#include <utility>
 
 #include "corenetwork.h"
 #include "eventmanager.h"
 
 #include "corenetwork.h"
 #include "eventmanager.h"
@@ -36,7 +37,7 @@ class CtcpParser : public QObject
     Q_OBJECT
 
 public:
     Q_OBJECT
 
 public:
-    CtcpParser(CoreSession *coreSession, QObject *parent = 0);
+    CtcpParser(CoreSession *coreSession, QObject *parent = nullptr);
 
     inline CoreSession *coreSession() const { return _coreSession; }
 
 
     inline CoreSession *coreSession() const { return _coreSession; }
 
@@ -75,18 +76,21 @@ protected:
     QByteArray pack(const QByteArray &ctcpTag, const QByteArray &message);
     void packedReply(CoreNetwork *network, const QString &bufname, const QList<QByteArray> &replies);
 
     QByteArray pack(const QByteArray &ctcpTag, const QByteArray &message);
     void packedReply(CoreNetwork *network, const QString &bufname, const QList<QByteArray> &replies);
 
+private slots:
+    void setStandardCtcp(bool enabled);
+
 private:
     inline QString targetDecode(IrcEventRawMessage *e, const QByteArray &msg) { return coreNetwork(e)->userDecode(e->target(), msg); }
 
     CoreSession *_coreSession;
 
     struct CtcpReply {
 private:
     inline QString targetDecode(IrcEventRawMessage *e, const QByteArray &msg) { return coreNetwork(e)->userDecode(e->target(), msg); }
 
     CoreSession *_coreSession;
 
     struct CtcpReply {
-        CoreNetwork *network;
+        CoreNetwork *network{nullptr};
         QString bufferName;
         QList<QByteArray> replies;
 
         QString bufferName;
         QList<QByteArray> replies;
 
-        CtcpReply() : network(0) {}
-        CtcpReply(CoreNetwork *net, const QString &buf) : network(net), bufferName(buf) {}
+        CtcpReply()  {}
+        CtcpReply(CoreNetwork *net, QString buf) : network(net), bufferName(std::move(buf)) {}
     };
 
     QHash<QUuid, CtcpReply> _replies;
     };
 
     QHash<QUuid, CtcpReply> _replies;