mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Undo: only show warning message if dives were actually edited
The multiple-dives-edited message was shown even if the value was not changed. Notably, when tab-flipping through the dive fields. Therefore, changed the execute_edit() function to return zero when no command was executed. For this, return a boolean from the execute() function indicating whether the command was really executed or trashed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
		
							parent
							
								
									944a9aed54
								
							
						
					
					
						commit
						f51e402e04
					
				
					 3 changed files with 10 additions and 8 deletions
				
			
		|  | @ -148,9 +148,8 @@ void purgeUnusedDiveSites() | |||
| // Execute an edit-command and return number of edited dives
 | ||||
| static int execute_edit(EditDivesBase *cmd) | ||||
| { | ||||
| 	int res = cmd->numDives(); | ||||
| 	execute(cmd); | ||||
| 	return res; | ||||
| 	int count = cmd->numDives(); | ||||
| 	return execute(cmd) ? count : 0; | ||||
| } | ||||
| 
 | ||||
| // Dive editing related commands
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue