aboutsummaryrefslogtreecommitdiff
path: root/backends/cloud
diff options
context:
space:
mode:
authorAlexander Tkachev2016-06-05 11:35:18 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit69aed03c4f6b23302836315502cd9abbb395415e (patch)
tree3623778212097b5058d32d91e2404543dd8349fc /backends/cloud
parent91f75efa99ffe6d1c4e8e9b9b1fec368af192b7d (diff)
downloadscummvm-rg350-69aed03c4f6b23302836315502cd9abbb395415e.tar.gz
scummvm-rg350-69aed03c4f6b23302836315502cd9abbb395415e.tar.bz2
scummvm-rg350-69aed03c4f6b23302836315502cd9abbb395415e.zip
CLOUD: Add new CloudManager shortcuts
CloudIcon can easily use CloudMan.isWorking()
Diffstat (limited to 'backends/cloud')
-rw-r--r--backends/cloud/cloudmanager.cpp24
-rw-r--r--backends/cloud/cloudmanager.h12
2 files changed, 36 insertions, 0 deletions
diff --git a/backends/cloud/cloudmanager.cpp b/backends/cloud/cloudmanager.cpp
index 92e45e8811..20d75726af 100644
--- a/backends/cloud/cloudmanager.cpp
+++ b/backends/cloud/cloudmanager.cpp
@@ -126,4 +126,28 @@ void CloudManager::testFeature() {
if (storage) storage->info(nullptr, nullptr);
}
+bool CloudManager::isWorking() {
+ Storage *storage = getCurrentStorage();
+ if (storage) return storage->isWorking();
+ return false;
+}
+
+bool CloudManager::isSyncing() {
+ Storage *storage = getCurrentStorage();
+ if (storage) return storage->isSyncing();
+ return false;
+}
+
+double CloudManager::getSyncProgress() {
+ Storage *storage = getCurrentStorage();
+ if (storage) return storage->getSyncProgress();
+ return 1;
+}
+
+Common::Array<Common::String> CloudManager::getSyncingFiles() {
+ Storage *storage = getCurrentStorage();
+ if (storage) return storage->getSyncingFiles();
+ return Common::Array<Common::String>();
+}
+
} // End of namespace Common
diff --git a/backends/cloud/cloudmanager.h b/backends/cloud/cloudmanager.h
index a13eeebb94..fa3a87de8b 100644
--- a/backends/cloud/cloudmanager.h
+++ b/backends/cloud/cloudmanager.h
@@ -77,6 +77,18 @@ public:
* Starts feature testing (the one I'm working on currently). (Temporary)
*/
void testFeature();
+
+ /** Returns whether there are any requests running. */
+ bool isWorking();
+
+ /** Returns whether there is a SavesSyncRequest running. */
+ bool isSyncing();
+
+ /** Returns a number in [0, 1] range which represents current sync progress (1 = complete). */
+ double getSyncProgress();
+
+ /** Returns an array of saves names which are not yet synced (thus cannot be used). */
+ Common::Array<Common::String> getSyncingFiles();
};
/** Shortcut for accessing the connection manager. */