From e0bb886098b5992e004e7b57dc14d55180c9a17b Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Sun, 5 Nov 2017 06:15:08 -0800 Subject: [PATCH] replace native browser invocation with signal --- oauth/kqoauthmanager.cpp | 7 +++++-- oauth/kqoauthmanager.h | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/oauth/kqoauthmanager.cpp b/oauth/kqoauthmanager.cpp index 4471a50..b1e2589 100644 --- a/oauth/kqoauthmanager.cpp +++ b/oauth/kqoauthmanager.cpp @@ -464,7 +464,8 @@ void KQOAuthManager::getOauth2UserAuthorization(QUrl authorizationEndpoint, QStr } } qDebug() << openWebPageUrl.toString(); - navigator_invoke(openWebPageUrl.toString().toStdString().c_str(),0); + // navigator_invoke(openWebPageUrl.toString().toStdString().c_str(),0); + emit openBrowser(openWebPageUrl); } QUrl KQOAuthManager::getUserAuthorizationUrl(QUrl authorizationEndpoint) { @@ -499,7 +500,8 @@ void KQOAuthManager::getUserAuthorization(QUrl authorizationEndpoint) { // Open the user's default browser to the resource authorization page provided // by the service. - navigator_invoke(openWebPageUrl.toString().toStdString().c_str(),0); + // navigator_invoke(openWebPageUrl.toString().toStdString().c_str(),0); + emit openBrowser(openWebPageUrl); } } @@ -670,6 +672,7 @@ void KQOAuthManager::onAuthorizedRequestReplyReceived( QNetworkReply *reply ) { // Just don't do anything if we didn't get anything useful. if(networkReply.isEmpty()) { + qDebug() << "EMPTY REPLY"; reply->deleteLater(); return; } diff --git a/oauth/kqoauthmanager.h b/oauth/kqoauthmanager.h index 6778626..30af718 100644 --- a/oauth/kqoauthmanager.h +++ b/oauth/kqoauthmanager.h @@ -187,6 +187,8 @@ Q_SIGNALS: // This ends the kQOAuth interactions. void authorizedRequestDone(); + void openBrowser(QUrl url); + private Q_SLOTS: void onRequestReplyReceived( QNetworkReply *reply ); void onAuthorizedRequestReplyReceived( QNetworkReply *reply );