diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-05-10 15:02:43 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2019-05-14 15:14:44 +0000 |
commit | d2dd87b0a69f0bcc23c4f7ebf9a1210731f3e2c3 (patch) | |
tree | 6937b113009bb17b0759875ab1ecf8bab8c81218 | |
parent | ae8d1fef58fa6df1408b9b11cf4b99dc7815255f (diff) |
Remove the protected constructor from QCoapClient
This change is based on the feedback from API review.
Change-Id: I99f00d15e9474b2844a436113ac7771ead7b33c6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | src/coap/qcoapclient.cpp | 13 | ||||
-rw-r--r-- | src/coap/qcoapclient.h | 3 | ||||
-rw-r--r-- | tests/auto/qcoapclient/tst_qcoapclient.cpp | 7 |
3 files changed, 4 insertions, 19 deletions
diff --git a/src/coap/qcoapclient.cpp b/src/coap/qcoapclient.cpp index 197e407..b11a5b2 100644 --- a/src/coap/qcoapclient.cpp +++ b/src/coap/qcoapclient.cpp @@ -160,7 +160,7 @@ QCoapClientPrivate::~QCoapClientPrivate() constructors. */ QCoapClient::QCoapClient(QtCoap::SecurityMode securityMode, QObject *parent) : - QCoapClient(new QCoapProtocol, new QCoapQUdpConnection(securityMode), parent) + QCoapClient(new QCoapQUdpConnection(securityMode), parent) { } @@ -169,16 +169,7 @@ QCoapClient::QCoapClient(QtCoap::SecurityMode securityMode, QObject *parent) : sets \a parent as the parent object. */ QCoapClient::QCoapClient(QCoapConnection *connection, QObject *parent) : - QCoapClient(new QCoapProtocol, connection, parent) -{ -} - -/*! - Base constructor, taking the \a protocol, \a connection, and \a parent - as arguments. -*/ -QCoapClient::QCoapClient(QCoapProtocol *protocol, QCoapConnection *connection, QObject *parent) : - QObject(*new QCoapClientPrivate(protocol, connection), parent) + QObject(*new QCoapClientPrivate(new QCoapProtocol, connection), parent) { Q_D(QCoapClient); diff --git a/src/coap/qcoapclient.h b/src/coap/qcoapclient.h index fb06903..06290ce 100644 --- a/src/coap/qcoapclient.h +++ b/src/coap/qcoapclient.h @@ -95,9 +95,6 @@ Q_SIGNALS: void error(QCoapReply *reply, QtCoap::Error error); protected: - explicit QCoapClient(QCoapProtocol *protocol, QCoapConnection *connection, - QObject *parent = nullptr); - Q_DECLARE_PRIVATE(QCoapClient) }; diff --git a/tests/auto/qcoapclient/tst_qcoapclient.cpp b/tests/auto/qcoapclient/tst_qcoapclient.cpp index 2a9f9d4..8f0302e 100644 --- a/tests/auto/qcoapclient/tst_qcoapclient.cpp +++ b/tests/auto/qcoapclient/tst_qcoapclient.cpp @@ -108,7 +108,7 @@ class QCoapClientForSocketErrorTests : public QCoapClient { public: QCoapClientForSocketErrorTests() : - QCoapClient(new QCoapProtocol, new QCoapQUdpConnectionSocketTests) + QCoapClient(new QCoapQUdpConnectionSocketTests) {} QCoapQUdpConnection *connection() @@ -122,9 +122,6 @@ class QCoapClientForTests : public QCoapClient { public: QCoapClientForTests() {} - QCoapClientForTests(QCoapProtocol *protocol, QCoapQUdpConnection *connection) : - QCoapClient(protocol, connection) - {} QCoapProtocol *protocol() { @@ -165,7 +162,7 @@ class QCoapClientForMulticastTests : public QCoapClient { public: QCoapClientForMulticastTests() : - QCoapClient(new QCoapProtocol, new QCoapConnectionMulticastTests) + QCoapClient(new QCoapConnectionMulticastTests) {} QCoapConnection *connection() |