mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	QML UI: fix order of tests when saving changes
Only check for previous cloud connection when actually trying to save to cloud Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									247358be37
								
							
						
					
					
						commit
						c6205b5819
					
				
					 1 changed files with 6 additions and 4 deletions
				
			
		| 
						 | 
					@ -246,6 +246,7 @@ void QMLManager::saveCloudCredentials()
 | 
				
			||||||
		// just go back to the dive list
 | 
							// just go back to the dive list
 | 
				
			||||||
		setCredentialStatus(oldStatus());
 | 
							setCredentialStatus(oldStatus());
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!same_string(prefs.cloud_storage_password, qPrintable(cloudPassword()))) {
 | 
						if (!same_string(prefs.cloud_storage_password, qPrintable(cloudPassword()))) {
 | 
				
			||||||
		free(prefs.cloud_storage_password);
 | 
							free(prefs.cloud_storage_password);
 | 
				
			||||||
		prefs.cloud_storage_password = strdup(qPrintable(cloudPassword()));
 | 
							prefs.cloud_storage_password = strdup(qPrintable(cloudPassword()));
 | 
				
			||||||
| 
						 | 
					@ -864,10 +865,6 @@ void QMLManager::saveChangesCloud(bool forceRemoteSync)
 | 
				
			||||||
		appendTextToLog("asked to save changes but no unsaved changes");
 | 
							appendTextToLog("asked to save changes but no unsaved changes");
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (!loadFromCloud()) {
 | 
					 | 
				
			||||||
		appendTextToLog("Don't save dives without loading from the cloud, first.");
 | 
					 | 
				
			||||||
		return;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if (alreadySaving) {
 | 
						if (alreadySaving) {
 | 
				
			||||||
		appendTextToLog("save operation in progress already");
 | 
							appendTextToLog("save operation in progress already");
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
| 
						 | 
					@ -879,6 +876,11 @@ void QMLManager::saveChangesCloud(bool forceRemoteSync)
 | 
				
			||||||
	if (prefs.git_local_only && !forceRemoteSync)
 | 
						if (prefs.git_local_only && !forceRemoteSync)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!loadFromCloud()) {
 | 
				
			||||||
 | 
							appendTextToLog("Don't save dives without loading from the cloud, first.");
 | 
				
			||||||
 | 
							return;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	bool glo = prefs.git_local_only;
 | 
						bool glo = prefs.git_local_only;
 | 
				
			||||||
	git_storage_update_progress(false, "start save change to cloud");
 | 
						git_storage_update_progress(false, "start save change to cloud");
 | 
				
			||||||
	prefs.git_local_only = false;
 | 
						prefs.git_local_only = false;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue