diff options
author | Jesus Fernandez <jesus.fernandez@qt.io> | 2017-05-19 12:40:13 +0200 |
---|---|---|
committer | Jesus Fernandez <Jesus.Fernandez@qt.io> | 2017-06-07 12:50:47 +0000 |
commit | aa52bdacbff744c2bf20845f8c0a78aeb21d9878 (patch) | |
tree | 367f24472c7329a9f074f4223223c08c5def09df | |
parent | 4d28fe828ea0ac381309983b2d071b89ee69397e (diff) |
Use delegating constructors
Use delegating constructors in QOAuth2AuthorizationCodeFlow to avoid
repeating code.
Change-Id: I5866fd19b40f5f5496d2c6982c7fa5abb414c1ba
Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
-rw-r--r-- | src/oauth/qoauth2authorizationcodeflow.cpp | 11 | ||||
-rw-r--r-- | src/oauth/qoauth2authorizationcodeflow_p.h | 1 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/oauth/qoauth2authorizationcodeflow.cpp b/src/oauth/qoauth2authorizationcodeflow.cpp index 8ccd5ab..c16d636 100644 --- a/src/oauth/qoauth2authorizationcodeflow.cpp +++ b/src/oauth/qoauth2authorizationcodeflow.cpp @@ -79,10 +79,6 @@ QOAuth2AuthorizationCodeFlowPrivate::QOAuth2AuthorizationCodeFlowPrivate( accessTokenUrl(accessTokenUrl) {} -QOAuth2AuthorizationCodeFlowPrivate::QOAuth2AuthorizationCodeFlowPrivate( - QNetworkAccessManager *manager) : QAbstractOAuth2Private(manager) -{} - void QOAuth2AuthorizationCodeFlowPrivate::_q_handleCallback(const QVariantMap &data) { Q_Q(QOAuth2AuthorizationCodeFlow); @@ -178,7 +174,8 @@ void QOAuth2AuthorizationCodeFlowPrivate::_q_authenticate(QNetworkReply *reply, object \a parent. */ QOAuth2AuthorizationCodeFlow::QOAuth2AuthorizationCodeFlow(QObject *parent) : - QAbstractOAuth2(*new QOAuth2AuthorizationCodeFlowPrivate, parent) + QOAuth2AuthorizationCodeFlow(nullptr, + parent) {} /*! @@ -187,7 +184,9 @@ QOAuth2AuthorizationCodeFlow::QOAuth2AuthorizationCodeFlow(QObject *parent) : */ QOAuth2AuthorizationCodeFlow::QOAuth2AuthorizationCodeFlow(QNetworkAccessManager *manager, QObject *parent) : - QAbstractOAuth2(*new QOAuth2AuthorizationCodeFlowPrivate(manager), parent) + QOAuth2AuthorizationCodeFlow(QString(), + manager, + parent) {} /*! diff --git a/src/oauth/qoauth2authorizationcodeflow_p.h b/src/oauth/qoauth2authorizationcodeflow_p.h index e05881c..4115775 100644 --- a/src/oauth/qoauth2authorizationcodeflow_p.h +++ b/src/oauth/qoauth2authorizationcodeflow_p.h @@ -62,7 +62,6 @@ public: const QUrl &accessTokenUrl, const QString &clientIdentifier, QNetworkAccessManager *manager = nullptr); - QOAuth2AuthorizationCodeFlowPrivate(QNetworkAccessManager *manager = nullptr); void _q_handleCallback(const QVariantMap &data); void _q_accessTokenRequestFinished(const QVariantMap &values); |