diff options
author | Alexander Tkachev | 2016-05-31 16:23:25 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | 3638c8348d98273da5c4e2c5bd1afa8a985a2d0c (patch) | |
tree | 0f3e1a20e5a25c051e901f318f42cb2c1251789f /backends/cloud/onedrive | |
parent | b39f46788a70a6c72d5ca678c79c0b53ebde9b68 (diff) | |
download | scummvm-rg350-3638c8348d98273da5c4e2c5bd1afa8a985a2d0c.tar.gz scummvm-rg350-3638c8348d98273da5c4e2c5bd1afa8a985a2d0c.tar.bz2 scummvm-rg350-3638c8348d98273da5c4e2c5bd1afa8a985a2d0c.zip |
CLOUD: Make SavesSyncRequest work with OneDrive
It actually works fine, but small Storage::savesDirectoryPath() was
added, because Dropbox's directories must start with a slash, and
OneDrive's directories must not.
Saves sync tested and it works fine with OneDrive.
Diffstat (limited to 'backends/cloud/onedrive')
-rw-r--r-- | backends/cloud/onedrive/onedrivestorage.cpp | 9 | ||||
-rw-r--r-- | backends/cloud/onedrive/onedrivestorage.h | 3 |
2 files changed, 6 insertions, 6 deletions
diff --git a/backends/cloud/onedrive/onedrivestorage.cpp b/backends/cloud/onedrive/onedrivestorage.cpp index fe10580616..1e9a641e8a 100644 --- a/backends/cloud/onedrive/onedrivestorage.cpp +++ b/backends/cloud/onedrive/onedrivestorage.cpp @@ -238,14 +238,11 @@ Networking::Request *OneDriveStorage::syncSaves(BoolCallback callback, Networkin request->addHeader("Authorization: bearer " + _token); return ConnMan.addRequest(request); */ - //return downloadFolder("subfolder", "local/onedrive/subfolder_downloaded", new Common::Callback<OneDriveStorage, FileArrayResponse>(this, &OneDriveStorage::printFiles), false); - return Storage::upload( - "uploads/test.jpg", "test.jpg", - new Common::Callback<OneDriveStorage, UploadResponse>(this, &OneDriveStorage::printFile), getErrorPrintingCallback() - ); - //return ConnMan.addRequest(new SavesSyncRequest(this, new Common::Callback<OneDriveStorage, BoolResponse>(this, &OneDriveStorage::printBool), getErrorPrintingCallback())); //TODO + return ConnMan.addRequest(new SavesSyncRequest(this, new Common::Callback<OneDriveStorage, BoolResponse>(this, &OneDriveStorage::printBool), getErrorPrintingCallback())); //TODO } +Common::String OneDriveStorage::savesDirectoryPath() { return "saves/"; } + OneDriveStorage *OneDriveStorage::loadFromConfig(Common::String keyPrefix) { loadKeyAndSecret(); diff --git a/backends/cloud/onedrive/onedrivestorage.h b/backends/cloud/onedrive/onedrivestorage.h index 0ced98cd4e..45a8dca331 100644 --- a/backends/cloud/onedrive/onedrivestorage.h +++ b/backends/cloud/onedrive/onedrivestorage.h @@ -107,6 +107,9 @@ public: /** Returns the StorageInfo struct. */ virtual Networking::Request *info(StorageInfoCallback callback, Networking::ErrorCallback errorCallback) { return nullptr; } //TODO + /** Returns storage's saves directory path with the trailing slash. */ + virtual Common::String savesDirectoryPath(); + /** Returns whether saves sync process is running. */ virtual bool isSyncing() { return false; } //TODO |