diff options
| author | 2018-06-10 00:16:59 +0100 | |
|---|---|---|
| committer | 2018-11-14 08:59:22 -0500 | |
| commit | e4a34cb9b7d59a08a162d642fbbca8c08804b3ff (patch) | |
| tree | b3c5524281b4714da91729ffd19c9abbc95f8c62 /src/modules/objects/qthttp | |
| parent | Use C++14 (diff) | |
| download | KVIrc-e4a34cb9b7d59a08a162d642fbbca8c08804b3ff.tar.gz KVIrc-e4a34cb9b7d59a08a162d642fbbca8c08804b3ff.tar.bz2 KVIrc-e4a34cb9b7d59a08a162d642fbbca8c08804b3ff.zip | |
Apply all modernize-* fixes from clang-tidy except for modernize-use-auto
Diffstat (limited to 'src/modules/objects/qthttp')
| -rw-r--r-- | src/modules/objects/qthttp/qhttp.cpp | 38 | ||||
| -rw-r--r-- | src/modules/objects/qthttp/qhttpauthenticator.cpp | 8 |
2 files changed, 30 insertions, 16 deletions
diff --git a/src/modules/objects/qthttp/qhttp.cpp b/src/modules/objects/qthttp/qhttp.cpp index dbecaa42e..84e5e28e5 100644 --- a/src/modules/objects/qthttp/qhttp.cpp +++ b/src/modules/objects/qthttp/qhttp.cpp @@ -42,6 +42,8 @@ //#define QHTTP_DEBUG #include <qplatformdefs.h> + +#include <utility> #include "qhttp.h" #ifndef QT_NO_HTTP @@ -71,7 +73,7 @@ class QHttpNormalRequest; class QHttpRequest { public: - QHttpRequest() : finished(false) + QHttpRequest() { id = idCounter.fetchAndAddRelaxed(1); } @@ -86,7 +88,7 @@ public: virtual QIODevice * destinationDevice() = 0; int id; - bool finished; + bool finished{ false }; private: static QBasicAtomicInt idCounter; @@ -98,11 +100,20 @@ public: Q_DECLARE_PUBLIC(QHttp) inline QHttpPrivate(QHttp * parent) - : socket(nullptr), reconnectAttempts(2), - deleteSocket(0), state(QHttp::Unconnected), - error(QHttp::NoError), port(0), mode(QHttp::ConnectionModeHttp), - toDevice(nullptr), postDevice(nullptr), bytesDone(0), chunkedSize(-1), - repost(false), pendingPost(false), q_ptr(parent) + : socket(nullptr) + , reconnectAttempts(2) + , deleteSocket(false) + , state(QHttp::Unconnected) + , error(QHttp::NoError) + , port(0) + , mode(QHttp::ConnectionModeHttp) + , toDevice(nullptr) + , postDevice(nullptr) + , bytesDone(0) + , chunkedSize(-1) + , repost(false) + , pendingPost(false) + , q_ptr(parent) { } @@ -346,8 +357,10 @@ void QHttpPGHRequest::start(QHttp * http) class QHttpSetHostRequest : public QHttpRequest { public: - QHttpSetHostRequest(const QString & h, quint16 p, QHttp::ConnectionMode m) - : hostName(h), port(p), mode(m) + QHttpSetHostRequest(QString h, quint16 p, QHttp::ConnectionMode m) + : hostName(std::move(h)) + , port(p) + , mode(m) { } @@ -396,7 +409,9 @@ void QHttpSetHostRequest::start(QHttp * http) class QHttpSetUserRequest : public QHttpRequest { public: - QHttpSetUserRequest(const QString & userName, const QString & password) : user(userName), pass(password) + QHttpSetUserRequest(QString userName, QString password) + : user(std::move(userName)) + , pass(std::move(password)) { } @@ -510,8 +525,7 @@ class QHttpCloseRequest : public QHttpRequest { public: QHttpCloseRequest() - { - } + = default; void start(QHttp *) override; QIODevice * sourceDevice() override diff --git a/src/modules/objects/qthttp/qhttpauthenticator.cpp b/src/modules/objects/qthttp/qhttpauthenticator.cpp index c6063c6c4..194fe856d 100644 --- a/src/modules/objects/qthttp/qhttpauthenticator.cpp +++ b/src/modules/objects/qthttp/qhttpauthenticator.cpp @@ -860,10 +860,10 @@ const quint8 hirespversion = 1; class QNtlmBuffer { public: - QNtlmBuffer() : len(0), maxLen(0), offset(0) {} - quint16 len; - quint16 maxLen; - quint32 offset; + QNtlmBuffer() {} + quint16 len{ 0 }; + quint16 maxLen{ 0 }; + quint32 offset{ 0 }; enum { Size = 8 |
