aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud
diff options
context:
space:
mode:
Diffstat (limited to 'backends/cloud')
-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;