Complete support for new scopes and make readdir() only update the currently read directory.

This commit is contained in:
Magnus Gille
2016-01-02 23:22:50 -05:00
parent 95d7f51077
commit 2d45f4ae55
5 changed files with 186 additions and 78 deletions

View File

@@ -24,6 +24,8 @@
#include "TimeUtils.h"
#if QT_VERSION > 0x050000
#include "GoogleDrive.h"
#include <QJsonParseError>
#endif
@@ -132,11 +134,9 @@ OAuthDialog::OAuthDialog(Context *context, OAuthSite site) :
urlstr.append("redirect_uri=urn:ietf:wg:oauth:2.0:oob&");
urlstr.append("response_type=code&");
urlstr.append("client_id=").append(GC_GOOGLE_CALENDAR_CLIENT_ID);
#if QT_VERSION >= 0x050000
} else if (site == GOOGLE_DRIVE) {
const QString scope =
appsettings->cvalue(
context->athlete->cyclist,
GC_GOOGLE_DRIVE_AUTH_SCOPE, "drive.appdata").toString();
const QString scope = GoogleDrive::GetScope(context);
// OAUTH 2.0 - Google flow for installed applications
urlstr = QString("https://accounts.google.com/o/oauth2/auth?");
// We only request access to the application data folder, not all files.
@@ -144,6 +144,7 @@ OAuthDialog::OAuthDialog(Context *context, OAuthSite site) :
urlstr.append("redirect_uri=urn:ietf:wg:oauth:2.0:oob&");
urlstr.append("response_type=code&");
urlstr.append("client_id=").append(GC_GOOGLE_DRIVE_CLIENT_ID);
#endif
}
// different process to get the token for STRAVA, CYCLINGANALYTICS vs.