diff options
author | Alexander Tkachev | 2016-07-14 09:19:12 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | b4e9e35e07538a118588742aff6fd4a7a2b4d600 (patch) | |
tree | f332710318f4880baf8fc7f58902caca3314d77d /backends/cloud/googledrive | |
parent | 0b5bd18d8525e16749ad422913800b2120021240 (diff) | |
download | scummvm-rg350-b4e9e35e07538a118588742aff6fd4a7a2b4d600.tar.gz scummvm-rg350-b4e9e35e07538a118588742aff6fd4a7a2b4d600.tar.bz2 scummvm-rg350-b4e9e35e07538a118588742aff6fd4a7a2b4d600.zip |
CLOUD: Cleanup in Storages
Diffstat (limited to 'backends/cloud/googledrive')
-rw-r--r-- | backends/cloud/googledrive/googledrivestorage.cpp | 37 | ||||
-rw-r--r-- | backends/cloud/googledrive/googledrivestorage.h | 11 |
2 files changed, 0 insertions, 48 deletions
diff --git a/backends/cloud/googledrive/googledrivestorage.cpp b/backends/cloud/googledrive/googledrivestorage.cpp index eeae2f2ee3..2816301cac 100644 --- a/backends/cloud/googledrive/googledrivestorage.cpp +++ b/backends/cloud/googledrive/googledrivestorage.cpp @@ -216,11 +216,6 @@ Networking::Request *GoogleDriveStorage::streamFileById(Common::String id, Netwo return nullptr; } -void GoogleDriveStorage::fileDownloaded(BoolResponse response) { - if (response.value) debug("file downloaded!"); - else debug("download failed!"); -} - void GoogleDriveStorage::printInfo(StorageInfoResponse response) { debug("\nuser info:"); debug("\tname: %s", response.value.name().c_str()); @@ -279,41 +274,9 @@ GoogleDriveStorage *GoogleDriveStorage::loadFromConfig(Common::String keyPrefix) return new GoogleDriveStorage(accessToken, refreshToken); } -Common::String GoogleDriveStorage::getAuthLink() { - Common::String url = "https://accounts.google.com/o/oauth2/auth"; - url += "?response_type=code"; - url += "&redirect_uri=http://localhost"; //that's for copy-pasting - //url += "&redirect_uri=http%3A%2F%2Flocalhost"; //that's "http://localhost" for automatic opening - url += "&client_id="; url += KEY; - url += "&scope=https://www.googleapis.com/auth/drive"; //for copy-pasting - return url; -} - Common::String GoogleDriveStorage::getRootDirectoryId() { return "root"; } - -void GoogleDriveStorage::authThroughConsole() { - if (!ConfMan.hasKey("GOOGLE_DRIVE_KEY", ConfMan.kCloudDomain) || !ConfMan.hasKey("GOOGLE_DRIVE_SECRET", ConfMan.kCloudDomain)) { - warning("No Google Drive keys available, cannot do auth"); - return; - } - - loadKeyAndSecret(); - - if (ConfMan.hasKey("googledrive_code", ConfMan.kCloudDomain)) { - //phase 2: get access_token using specified code - new GoogleDriveStorage(ConfMan.get("googledrive_code", ConfMan.kCloudDomain)); - return; - } - - debug("Navigate to this URL and press \"Allow\":"); - debug("%s\n", getAuthLink().c_str()); - debug("Then, add googledrive_code key in [cloud] section of configuration file. You should copy the <code> value from URL and put it as value for that key.\n"); - debug("Navigate to this URL to get more information on ScummVM's configuration files:"); - debug("http://wiki.scummvm.org/index.php/User_Manual/Configuring_ScummVM#Using_the_configuration_file_to_configure_ScummVM\n"); -} - } // End of namespace GoogleDrive } // End of namespace Cloud diff --git a/backends/cloud/googledrive/googledrivestorage.h b/backends/cloud/googledrive/googledrivestorage.h index 435f9998a3..4a7dbab99f 100644 --- a/backends/cloud/googledrive/googledrivestorage.h +++ b/backends/cloud/googledrive/googledrivestorage.h @@ -49,7 +49,6 @@ class GoogleDriveStorage: public Id::IdStorage { /** Returns bool based on JSON response from cloud. */ void createDirectoryInnerCallback(BoolCallback outerCallback, Networking::JsonResponse json); - void fileDownloaded(BoolResponse response); void printInfo(StorageInfoResponse response); public: /** This constructor uses OAuth code flow to get tokens. */ @@ -104,19 +103,9 @@ public: */ static GoogleDriveStorage *loadFromConfig(Common::String keyPrefix); - /** - * Returns GoogleDrive auth link. - */ - static Common::String getAuthLink(); - virtual Common::String getRootDirectoryId(); /** - * Show message with GoogleDrive auth instructions. (Temporary) - */ - static void authThroughConsole(); - - /** * Gets new access_token. If <code> passed is "", refresh_token is used. * Use "" in order to refresh token and pass a callback, so you could * continue your work when new token is available. |