aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud/cloudmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/cloud/cloudmanager.cpp')
-rw-r--r--backends/cloud/cloudmanager.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/backends/cloud/cloudmanager.cpp b/backends/cloud/cloudmanager.cpp
index a1b1ed1525..9456dd84a4 100644
--- a/backends/cloud/cloudmanager.cpp
+++ b/backends/cloud/cloudmanager.cpp
@@ -135,6 +135,7 @@ void CloudManager::replaceStorage(Storage *storage, uint32 index) {
_activeStorage = storage;
_currentStorageIndex = index;
save();
+ if (_activeStorage) _activeStorage->info(nullptr, nullptr); //automatically calls setStorageUsername()
}
Storage *CloudManager::getCurrentStorage() const {
@@ -209,6 +210,34 @@ void CloudManager::printBool(Storage::BoolResponse response) const {
debug("bool = %s", (response.value ? "true" : "false"));
}
+Networking::Request *CloudManager::listDirectory(Common::String path, Storage::ListDirectoryCallback callback, Networking::ErrorCallback errorCallback, bool recursive) {
+ Storage *storage = getCurrentStorage();
+ if (storage) storage->listDirectory(path, callback, errorCallback, recursive);
+ else {
+ delete callback;
+ delete errorCallback;
+ //TODO: should we call errorCallback?
+ }
+ return nullptr;
+}
+
+Networking::Request *CloudManager::info(Storage::StorageInfoCallback callback, Networking::ErrorCallback errorCallback) {
+ Storage *storage = getCurrentStorage();
+ if (storage) storage->info(callback, errorCallback);
+ else {
+ delete callback;
+ delete errorCallback;
+ //TODO: should we call errorCallback?
+ }
+ return nullptr;
+}
+
+Common::String CloudManager::savesDirectoryPath() {
+ Storage *storage = getCurrentStorage();
+ if (storage) return storage->savesDirectoryPath();
+ return "";
+}
+
SavesSyncRequest *CloudManager::syncSaves(Storage::BoolCallback callback, Networking::ErrorCallback errorCallback) {
Storage *storage = getCurrentStorage();
if (storage) {