CLOUD: Do saves sync on Storage connect
This commit is contained in:
parent
0aea8db7e1
commit
8a84263d2b
4 changed files with 7 additions and 7 deletions
|
@ -124,7 +124,12 @@ void CloudManager::replaceStorage(Storage *storage, uint32 index) {
|
||||||
_activeStorage = storage;
|
_activeStorage = storage;
|
||||||
_currentStorageIndex = index;
|
_currentStorageIndex = index;
|
||||||
save();
|
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 {
|
Storage *CloudManager::getCurrentStorage() const {
|
||||||
|
|
|
@ -76,6 +76,7 @@ void DropboxStorage::codeFlowComplete(Networking::JsonResponse response) {
|
||||||
if (json) {
|
if (json) {
|
||||||
Common::JSONObject result = json->asObject();
|
Common::JSONObject result = json->asObject();
|
||||||
if (!result.contains("access_token") || !result.contains("uid")) {
|
if (!result.contains("access_token") || !result.contains("uid")) {
|
||||||
|
warning(json->stringify(true).c_str());
|
||||||
warning("Bad response, no token/uid passed");
|
warning("Bad response, no token/uid passed");
|
||||||
} else {
|
} else {
|
||||||
_token = result.getVal("access_token")->asString();
|
_token = result.getVal("access_token")->asString();
|
||||||
|
@ -83,8 +84,6 @@ void DropboxStorage::codeFlowComplete(Networking::JsonResponse response) {
|
||||||
CloudConfig.removeKey("dropbox_code");
|
CloudConfig.removeKey("dropbox_code");
|
||||||
CloudMan.replaceStorage(this, kStorageDropboxId);
|
CloudMan.replaceStorage(this, kStorageDropboxId);
|
||||||
CloudConfig.flushToDisk();
|
CloudConfig.flushToDisk();
|
||||||
debug("Done! You can use Dropbox now! Look:");
|
|
||||||
CloudMan.testFeature();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete json;
|
delete json;
|
||||||
|
|
|
@ -125,8 +125,6 @@ void GoogleDriveStorage::codeFlowComplete(BoolResponse response) {
|
||||||
CloudConfig.removeKey("googledrive_code");
|
CloudConfig.removeKey("googledrive_code");
|
||||||
CloudMan.replaceStorage(this, kStorageGoogleDriveId);
|
CloudMan.replaceStorage(this, kStorageGoogleDriveId);
|
||||||
CloudConfig.flushToDisk();
|
CloudConfig.flushToDisk();
|
||||||
debug("Done! You can use Google Drive now! Look:");
|
|
||||||
CloudMan.testFeature();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GoogleDriveStorage::saveConfig(Common::String keyPrefix) {
|
void GoogleDriveStorage::saveConfig(Common::String keyPrefix) {
|
||||||
|
|
|
@ -119,8 +119,6 @@ void OneDriveStorage::codeFlowComplete(BoolResponse response) {
|
||||||
CloudConfig.removeKey("onedrive_code");
|
CloudConfig.removeKey("onedrive_code");
|
||||||
CloudMan.replaceStorage(this, kStorageOneDriveId);
|
CloudMan.replaceStorage(this, kStorageOneDriveId);
|
||||||
CloudConfig.flushToDisk();
|
CloudConfig.flushToDisk();
|
||||||
debug("Done! You can use OneDrive now! Look:");
|
|
||||||
CloudMan.syncSaves();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OneDriveStorage::saveConfig(Common::String keyPrefix) {
|
void OneDriveStorage::saveConfig(Common::String keyPrefix) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue