mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Warn if we edit non-existant dive site
And try to add it to the dive - bubt we really shouldn't get here. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									3278953f86
								
							
						
					
					
						commit
						1b0812a8cb
					
				
					 1 changed files with 5 additions and 4 deletions
				
			
		| 
						 | 
					@ -143,12 +143,13 @@ void LocationInformationWidget::acceptChanges()
 | 
				
			||||||
	char *uiString;
 | 
						char *uiString;
 | 
				
			||||||
	struct dive_site *currentDs;
 | 
						struct dive_site *currentDs;
 | 
				
			||||||
	uiString = ui.diveSiteName->text().toUtf8().data();
 | 
						uiString = ui.diveSiteName->text().toUtf8().data();
 | 
				
			||||||
 | 
						if (get_dive_site_by_uuid(displayed_dive_site.uuid) != NULL) {
 | 
				
			||||||
	if (get_dive_site_by_uuid(displayed_dive_site.uuid) != NULL)
 | 
					 | 
				
			||||||
		currentDs = get_dive_site_by_uuid(displayed_dive_site.uuid);
 | 
							currentDs = get_dive_site_by_uuid(displayed_dive_site.uuid);
 | 
				
			||||||
	else
 | 
						} else {
 | 
				
			||||||
 | 
							qWarning() << "did not have valid dive site in LocationInformationWidget";
 | 
				
			||||||
		currentDs = get_dive_site_by_uuid(create_dive_site_from_current_dive(uiString));
 | 
							currentDs = get_dive_site_by_uuid(create_dive_site_from_current_dive(uiString));
 | 
				
			||||||
 | 
							displayed_dive.dive_site_uuid = currentDs->uuid;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	currentDs->latitude = displayed_dive_site.latitude;
 | 
						currentDs->latitude = displayed_dive_site.latitude;
 | 
				
			||||||
	currentDs->longitude = displayed_dive_site.longitude;
 | 
						currentDs->longitude = displayed_dive_site.longitude;
 | 
				
			||||||
	if (!same_string(uiString, currentDs->name)) {
 | 
						if (!same_string(uiString, currentDs->name)) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue