From 3638c8348d98273da5c4e2c5bd1afa8a985a2d0c Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Tue, 31 May 2016 16:23:25 +0600 Subject: 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. --- backends/cloud/onedrive/onedrivestorage.cpp | 9 +++------ backends/cloud/onedrive/onedrivestorage.h | 3 +++ 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'backends/cloud/onedrive') 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(this, &OneDriveStorage::printFiles), false); - return Storage::upload( - "uploads/test.jpg", "test.jpg", - new Common::Callback(this, &OneDriveStorage::printFile), getErrorPrintingCallback() - ); - //return ConnMan.addRequest(new SavesSyncRequest(this, new Common::Callback(this, &OneDriveStorage::printBool), getErrorPrintingCallback())); //TODO + return ConnMan.addRequest(new SavesSyncRequest(this, new Common::Callback(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 -- cgit v1.2.3