aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorAlexander Tkachev2016-06-05 15:22:26 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit8de2862eaa6513c43502bea86f53967015298884 (patch)
treea2060fd5a3e4e6c140f2553f80335c522656d670 /backends
parent8d09e1a6b3441315abf6e91b558b7ba820108d3e (diff)
downloadscummvm-rg350-8de2862eaa6513c43502bea86f53967015298884.tar.gz
scummvm-rg350-8de2862eaa6513c43502bea86f53967015298884.tar.bz2
scummvm-rg350-8de2862eaa6513c43502bea86f53967015298884.zip
CLOUD: Update syncSaves() to return SavesSyncRequest *
So other classes could use that information without casting.
Diffstat (limited to 'backends')
-rw-r--r--backends/cloud/cloudmanager.cpp5
-rw-r--r--backends/cloud/cloudmanager.h2
-rw-r--r--backends/cloud/storage.cpp6
-rw-r--r--backends/cloud/storage.h2
4 files changed, 8 insertions, 7 deletions
diff --git a/backends/cloud/cloudmanager.cpp b/backends/cloud/cloudmanager.cpp
index 20d75726af..b4598d7a97 100644
--- a/backends/cloud/cloudmanager.cpp
+++ b/backends/cloud/cloudmanager.cpp
@@ -116,9 +116,10 @@ void CloudManager::printBool(Storage::BoolResponse response) const {
debug("bool = %s", (response.value ? "true" : "false"));
}
-void CloudManager::syncSaves(Storage::BoolCallback callback, Networking::ErrorCallback errorCallback) {
+SavesSyncRequest *CloudManager::syncSaves(Storage::BoolCallback callback, Networking::ErrorCallback errorCallback) {
Storage *storage = getCurrentStorage();
- if (storage) storage->syncSaves(callback, errorCallback);
+ if (storage) return storage->syncSaves(callback, errorCallback);
+ return nullptr;
}
void CloudManager::testFeature() {
diff --git a/backends/cloud/cloudmanager.h b/backends/cloud/cloudmanager.h
index fa3a87de8b..a02dc90008 100644
--- a/backends/cloud/cloudmanager.h
+++ b/backends/cloud/cloudmanager.h
@@ -71,7 +71,7 @@ public:
/**
* Starts saves syncing process in currently active storage if there is any.
*/
- void syncSaves(Cloud::Storage::BoolCallback callback = nullptr, Networking::ErrorCallback errorCallback = nullptr);
+ SavesSyncRequest *syncSaves(Cloud::Storage::BoolCallback callback = nullptr, Networking::ErrorCallback errorCallback = nullptr);
/**
* Starts feature testing (the one I'm working on currently). (Temporary)
diff --git a/backends/cloud/storage.cpp b/backends/cloud/storage.cpp
index c1719d97b1..19f0845c47 100644
--- a/backends/cloud/storage.cpp
+++ b/backends/cloud/storage.cpp
@@ -97,7 +97,7 @@ Networking::Request *Storage::downloadFolder(Common::String remotePath, Common::
return addRequest(new FolderDownloadRequest(this, callback, errorCallback, remotePath, localPath, recursive));
}
-Networking::Request *Storage::syncSaves(BoolCallback callback, Networking::ErrorCallback errorCallback) {
+SavesSyncRequest *Storage::syncSaves(BoolCallback callback, Networking::ErrorCallback errorCallback) {
_runningRequestsMutex.lock();
if (_savesSyncRequest) {
warning("Storage::syncSaves: there is a sync in progress already");
@@ -106,8 +106,8 @@ Networking::Request *Storage::syncSaves(BoolCallback callback, Networking::Error
}
if (!errorCallback) errorCallback = getErrorPrintingCallback();
_savesSyncRequest = new SavesSyncRequest(this, callback, errorCallback);
- _runningRequestsMutex.unlock();
- return addRequest(_savesSyncRequest);
+ _runningRequestsMutex.unlock();
+ return (SavesSyncRequest *)addRequest(_savesSyncRequest); //who knows what that ConnMan could return in the future
}
bool Storage::isWorking() {
diff --git a/backends/cloud/storage.h b/backends/cloud/storage.h
index 0f518de5cd..5941fe4a32 100644
--- a/backends/cloud/storage.h
+++ b/backends/cloud/storage.h
@@ -124,7 +124,7 @@ public:
virtual Networking::Request *remove(Common::String path, BoolCallback callback, Networking::ErrorCallback errorCallback) = 0;
/** Calls the callback when finished. */
- virtual Networking::Request *syncSaves(BoolCallback callback, Networking::ErrorCallback errorCallback);
+ virtual SavesSyncRequest *syncSaves(BoolCallback callback, Networking::ErrorCallback errorCallback);
/** Calls the callback when finished. */
virtual Networking::Request *createDirectory(Common::String path, BoolCallback callback, Networking::ErrorCallback errorCallback) = 0;