1 diff -up ../../kqoauth/src//kqoauthmanager.cpp ./kqoauthmanager.cpp
2 --- ../../kqoauth/src//kqoauthmanager.cpp 2011-10-22 22:23:12.391025442 +0200
3 +++ ./kqoauthmanager.cpp 2011-10-22 22:44:06.897246201 +0200
5 * along with KQOAuth. If not, see <http://www.gnu.org/licenses/>.
8 -#include <QDesktopServices>
10 #include "kqoauthmanager.h"
11 #include "kqoauthmanager_p.h"
12 @@ -401,19 +400,19 @@ QNetworkAccessManager * KQOAuthManager::
14 //////////// Public convenience API /////////////
16 -void KQOAuthManager::getUserAuthorization(QUrl authorizationEndpoint) {
17 +QUrl KQOAuthManager::getUserAuthorization(QUrl authorizationEndpoint) {
20 if (!d->hasTemporaryToken) {
21 qWarning() << "No temporary tokens retreieved. Cannot get user authorization.";
22 d->error = KQOAuthManager::RequestUnauthorized;
27 if (!authorizationEndpoint.isValid()) {
28 qWarning() << "Authorization endpoint not valid. Cannot proceed.";
29 d->error = KQOAuthManager::RequestEndpointError;
34 d->error = KQOAuthManager::NoError;
35 @@ -422,9 +421,9 @@ void KQOAuthManager::getUserAuthorizatio
36 QUrl openWebPageUrl(authorizationEndpoint.toString(), QUrl::StrictMode);
37 openWebPageUrl.addQueryItem(tokenParam.first, tokenParam.second);
39 - // Open the user's default browser to the resource authorization page provided
41 - QDesktopServices::openUrl(openWebPageUrl);
42 + // Return the resource authorization page provided by the service.
43 + qDebug() << "KQOAuthManager::getUserAuthorization " << openWebPageUrl;
44 + return openWebPageUrl;
47 void KQOAuthManager::getUserAccessTokens(QUrl accessTokenEndpoint) {
48 diff -up ../../kqoauth/src//kqoauthmanager.h ./kqoauthmanager.h
49 --- ../../kqoauth/src//kqoauthmanager.h 2011-10-22 22:23:12.391025442 +0200
50 +++ ./kqoauthmanager.h 2011-10-22 22:39:48.715965943 +0200
51 @@ -103,7 +103,7 @@ public:
52 * us to access protected resources, the verifier token is stored in KQOAuthManager for further use.
53 * In order to use this method, you must set setHandleUserAuthorization() to true.
55 - void getUserAuthorization(QUrl authorizationEndpoint);
56 + QUrl getUserAuthorization(QUrl authorizationEndpoint);
58 * This is a convenience API for retrieving the access token in exchange for the temporary token and the