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/savessyncrequest.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'backends/cloud/savessyncrequest.cpp') diff --git a/backends/cloud/savessyncrequest.cpp b/backends/cloud/savessyncrequest.cpp index b48a99a48c..9727738654 100644 --- a/backends/cloud/savessyncrequest.cpp +++ b/backends/cloud/savessyncrequest.cpp @@ -60,7 +60,7 @@ void SavesSyncRequest::start() { //list saves directory _workingRequest = _storage->listDirectory( - "/saves", + _storage->savesDirectoryPath(), new Common::Callback(this, &SavesSyncRequest::directoryListedCallback), new Common::Callback(this, &SavesSyncRequest::directoryListedErrorCallback) ); @@ -165,6 +165,7 @@ void SavesSyncRequest::directoryListedErrorCallback(Networking::ErrorResponse er //we're lucky - user just lacks his "/cloud/" folder Common::Array files; directoryListedCallback(Storage::ListDirectoryResponse(error.request, files)); + //TODO: create it before uploading stuff } void SavesSyncRequest::downloadNextFile() { @@ -222,7 +223,7 @@ void SavesSyncRequest::uploadNextFile() { /////// debug("uploading %s", _currentUploadingFile.c_str()); /////// - _workingRequest = _storage->upload("/saves/" + _currentUploadingFile, g_system->getSavefileManager()->openRawFile(_currentUploadingFile), + _workingRequest = _storage->upload(_storage->savesDirectoryPath() + _currentUploadingFile, g_system->getSavefileManager()->openRawFile(_currentUploadingFile), new Common::Callback(this, &SavesSyncRequest::fileUploadedCallback), new Common::Callback(this, &SavesSyncRequest::fileUploadedErrorCallback) ); -- cgit v1.2.3