mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-09 03:10:22 +00:00
CLOUD: Do saves sync on Storage connect
This commit is contained in:
parent
0aea8db7e1
commit
8a84263d2b
@ -124,7 +124,12 @@ void CloudManager::replaceStorage(Storage *storage, uint32 index) {
|
||||
_activeStorage = storage;
|
||||
_currentStorageIndex = index;
|
||||
save();
|
||||
if (_activeStorage) _activeStorage->info(nullptr, nullptr); //automatically calls setStorageUsername()
|
||||
|
||||
//do what should be done on first Storage connect
|
||||
if (_activeStorage) {
|
||||
_activeStorage->info(nullptr, nullptr); //automatically calls setStorageUsername()
|
||||
_activeStorage->syncSaves(nullptr, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
Storage *CloudManager::getCurrentStorage() const {
|
||||
|
@ -76,6 +76,7 @@ void DropboxStorage::codeFlowComplete(Networking::JsonResponse response) {
|
||||
if (json) {
|
||||
Common::JSONObject result = json->asObject();
|
||||
if (!result.contains("access_token") || !result.contains("uid")) {
|
||||
warning(json->stringify(true).c_str());
|
||||
warning("Bad response, no token/uid passed");
|
||||
} else {
|
||||
_token = result.getVal("access_token")->asString();
|
||||
@ -83,8 +84,6 @@ void DropboxStorage::codeFlowComplete(Networking::JsonResponse response) {
|
||||
CloudConfig.removeKey("dropbox_code");
|
||||
CloudMan.replaceStorage(this, kStorageDropboxId);
|
||||
CloudConfig.flushToDisk();
|
||||
debug("Done! You can use Dropbox now! Look:");
|
||||
CloudMan.testFeature();
|
||||
}
|
||||
|
||||
delete json;
|
||||
|
@ -125,8 +125,6 @@ void GoogleDriveStorage::codeFlowComplete(BoolResponse response) {
|
||||
CloudConfig.removeKey("googledrive_code");
|
||||
CloudMan.replaceStorage(this, kStorageGoogleDriveId);
|
||||
CloudConfig.flushToDisk();
|
||||
debug("Done! You can use Google Drive now! Look:");
|
||||
CloudMan.testFeature();
|
||||
}
|
||||
|
||||
void GoogleDriveStorage::saveConfig(Common::String keyPrefix) {
|
||||
|
@ -119,8 +119,6 @@ void OneDriveStorage::codeFlowComplete(BoolResponse response) {
|
||||
CloudConfig.removeKey("onedrive_code");
|
||||
CloudMan.replaceStorage(this, kStorageOneDriveId);
|
||||
CloudConfig.flushToDisk();
|
||||
debug("Done! You can use OneDrive now! Look:");
|
||||
CloudMan.syncSaves();
|
||||
}
|
||||
|
||||
void OneDriveStorage::saveConfig(Common::String keyPrefix) {
|
||||
|
Loading…
Reference in New Issue
Block a user