changes for formeego, do not use
[googlelatitude] / libkqoauth / no_desktopservice.patch
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
4 @@ -18,7 +18,6 @@
5   *  along with KQOAuth.  If not, see <http://www.gnu.org/licenses/>.
6   */
7  #include <QtCore>
8 -#include <QDesktopServices>
9  
10  #include "kqoauthmanager.h"
11  #include "kqoauthmanager_p.h"
12 @@ -401,19 +400,19 @@ QNetworkAccessManager * KQOAuthManager::
13  
14  //////////// Public convenience API /////////////
15  
16 -void KQOAuthManager::getUserAuthorization(QUrl authorizationEndpoint) {
17 +QUrl KQOAuthManager::getUserAuthorization(QUrl authorizationEndpoint) {
18      Q_D(KQOAuthManager);
19  
20      if (!d->hasTemporaryToken) {
21          qWarning() << "No temporary tokens retreieved. Cannot get user authorization.";
22          d->error = KQOAuthManager::RequestUnauthorized;
23 -        return;
24 +        return QString();
25      }
26  
27      if (!authorizationEndpoint.isValid()) {
28          qWarning() << "Authorization endpoint not valid. Cannot proceed.";
29          d->error = KQOAuthManager::RequestEndpointError;
30 -        return;
31 +        return QString();
32      }
33  
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);
38  
39 -    // Open the user's default browser to the resource authorization page provided
40 -    // by the service.
41 -    QDesktopServices::openUrl(openWebPageUrl);
42 +    // Return the resource authorization page provided by the service.
43 +    qDebug() << "KQOAuthManager::getUserAuthorization " << openWebPageUrl;
44 +    return openWebPageUrl;
45  }
46  
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.
54       */
55 -    void getUserAuthorization(QUrl authorizationEndpoint);
56 +    QUrl getUserAuthorization(QUrl authorizationEndpoint);
57      /**
58       * This is a convenience API for retrieving the access token in exchange for the temporary token and the
59       * verifier.