diff options
author | Alexander Tkachev | 2019-07-27 22:44:15 +0700 |
---|---|---|
committer | Matan Bareket | 2019-07-30 14:51:41 -0400 |
commit | f6a17e679f4fac2fda21dc7f64565a0dc4a10ca1 (patch) | |
tree | 115b53d284e100ae04914ac90c1a4823ef95fb4f /backends/cloud/cloudmanager.cpp | |
parent | 85431c39bf191725910703f699fe95da595f6adf (diff) | |
download | scummvm-rg350-f6a17e679f4fac2fda21dc7f64565a0dc4a10ca1.tar.gz scummvm-rg350-f6a17e679f4fac2fda21dc7f64565a0dc4a10ca1.tar.bz2 scummvm-rg350-f6a17e679f4fac2fda21dc7f64565a0dc4a10ca1.zip |
CLOUD: Ask user to manually enable Storage
For more security, newly connected Storage only gets username/used space
information and is disabled until user manually presses the button.
Diffstat (limited to 'backends/cloud/cloudmanager.cpp')
-rw-r--r-- | backends/cloud/cloudmanager.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/backends/cloud/cloudmanager.cpp b/backends/cloud/cloudmanager.cpp index a3e9856455..38089db0e9 100644 --- a/backends/cloud/cloudmanager.cpp +++ b/backends/cloud/cloudmanager.cpp @@ -159,7 +159,6 @@ void CloudManager::replaceStorage(Storage *storage, uint32 index) { //do what should be done on first Storage connect if (_activeStorage) { _activeStorage->info(nullptr, nullptr); //automatically calls setStorageUsername() - _activeStorage->syncSaves(nullptr, nullptr); } } @@ -365,6 +364,21 @@ bool CloudManager::canSyncFilename(const Common::String &filename) const { return true; } +bool CloudManager::isStorageEnabled() const { + Storage *storage = getCurrentStorage(); + if (storage) + return storage->isEnabled(); + return false; +} + +void CloudManager::enableStorage() { + Storage *storage = getCurrentStorage(); + if (storage) { + storage->enable(); + save(); + } +} + SavesSyncRequest *CloudManager::syncSaves(Storage::BoolCallback callback, Networking::ErrorCallback errorCallback) { Storage *storage = getCurrentStorage(); if (storage) { |