CLOUD: Do saves sync on Storage connect

This commit is contained in:
Alexander Tkachev 2016-06-14 21:16:11 +06:00
parent 0aea8db7e1
commit 8a84263d2b
4 changed files with 7 additions and 7 deletions

View File

@ -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 {

View File

@ -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;

View File

@ -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) {

View File

@ -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) {