From d2dd87b0a69f0bcc23c4f7ebf9a1210731f3e2c3 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Fri, 10 May 2019 15:02:43 +0200 Subject: Remove the protected constructor from QCoapClient This change is based on the feedback from API review. Change-Id: I99f00d15e9474b2844a436113ac7771ead7b33c6 Reviewed-by: Simon Hausmann --- src/coap/qcoapclient.cpp | 13 ++----------- src/coap/qcoapclient.h | 3 --- 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() -- cgit v1.2.3