aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud/dropbox
diff options
context:
space:
mode:
authorAlexander Tkachev2016-05-31 19:18:06 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit0d0033fb6ad00e3081bc2854ce5972746b603105 (patch)
tree001f3f481609731d19dd5818e1789fa0d3a05faf /backends/cloud/dropbox
parent13351a730d79cc2f0d5b964226c69bb04e2c93c1 (diff)
downloadscummvm-rg350-0d0033fb6ad00e3081bc2854ce5972746b603105.tar.gz
scummvm-rg350-0d0033fb6ad00e3081bc2854ce5972746b603105.tar.bz2
scummvm-rg350-0d0033fb6ad00e3081bc2854ce5972746b603105.zip
CLOUD: Make syncSaves() common for all Storages
As it uses SavesSyncRequest and this request is using Storage's upload(), download() and listDirectory(), there is no need to make storage-dependent version of that request and so method could be implemented in base Storage.
Diffstat (limited to 'backends/cloud/dropbox')
-rw-r--r--backends/cloud/dropbox/dropboxstorage.cpp14
-rw-r--r--backends/cloud/dropbox/dropboxstorage.h6
2 files changed, 0 insertions, 20 deletions
diff --git a/backends/cloud/dropbox/dropboxstorage.cpp b/backends/cloud/dropbox/dropboxstorage.cpp
index beb510882a..1aae73e524 100644
--- a/backends/cloud/dropbox/dropboxstorage.cpp
+++ b/backends/cloud/dropbox/dropboxstorage.cpp
@@ -114,15 +114,6 @@ void DropboxStorage::printStorageFile(UploadResponse response) {
debug("\ttimestamp: %u", response.value.timestamp());
}
-void DropboxStorage::printErrorResponse(Networking::ErrorResponse error) {
- debug("error response (%s, %ld):", (error.failed ? "failed" : "interrupted"), error.httpResponseCode);
- debug("%s", error.response.c_str());
-}
-
-Networking::ErrorCallback DropboxStorage::getErrorPrintingCallback() {
- return new Common::Callback<DropboxStorage, Networking::ErrorResponse>(this, &DropboxStorage::printErrorResponse);
-}
-
Networking::Request *DropboxStorage::listDirectory(Common::String path, ListDirectoryCallback outerCallback, Networking::ErrorCallback errorCallback, bool recursive) {
return ConnMan.addRequest(new DropboxListDirectoryRequest(_token, path, outerCallback, errorCallback, recursive));
}
@@ -162,11 +153,6 @@ Networking::Request *DropboxStorage::downloadFolder(Common::String remotePath, C
return ConnMan.addRequest(new FolderDownloadRequest(this, callback, errorCallback, remotePath, localPath, recursive));
}
-Networking::Request *DropboxStorage::syncSaves(BoolCallback callback, Networking::ErrorCallback errorCallback) {
- //this might be the real syncSaves() implementation
- return ConnMan.addRequest(new SavesSyncRequest(this, new Common::Callback<DropboxStorage, BoolResponse>(this, &DropboxStorage::printBool), getErrorPrintingCallback())); //TODO
-}
-
Networking::Request *DropboxStorage::info(StorageInfoCallback outerCallback, Networking::ErrorCallback errorCallback) {
Networking::JsonCallback innerCallback = new Common::CallbackBridge<DropboxStorage, StorageInfoResponse, Networking::JsonResponse>(this, &DropboxStorage::infoInnerCallback, outerCallback);
Networking::CurlJsonRequest *request = new Networking::CurlJsonRequest(innerCallback, errorCallback, "https://api.dropboxapi.com/1/account/info");
diff --git a/backends/cloud/dropbox/dropboxstorage.h b/backends/cloud/dropbox/dropboxstorage.h
index 90a1d270e8..7752dddf9b 100644
--- a/backends/cloud/dropbox/dropboxstorage.h
+++ b/backends/cloud/dropbox/dropboxstorage.h
@@ -48,9 +48,6 @@ class DropboxStorage: public Cloud::Storage {
void printFiles(FileArrayResponse response);
void printBool(BoolResponse response);
void printStorageFile(UploadResponse response);
- void printErrorResponse(Networking::ErrorResponse error);
-
- Networking::ErrorCallback getErrorPrintingCallback();
public:
virtual ~DropboxStorage();
@@ -89,9 +86,6 @@ public:
virtual Networking::Request *remove(Common::String path, BoolCallback callback, Networking::ErrorCallback errorCallback) { return nullptr; } //TODO
/** Calls the callback when finished. */
- virtual Networking::Request *syncSaves(BoolCallback callback, Networking::ErrorCallback errorCallback);
-
- /** Calls the callback when finished. */
virtual Networking::Request *createDirectory(Common::String path, BoolCallback callback, Networking::ErrorCallback errorCallback) { return nullptr; } //TODO
/** Calls the callback when finished. */