mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Avoid duplicities on dive sites while importing
Instead of create an uuid for every imported dive, check if it exists. If not create a new one. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									f1ab6dd386
								
							
						
					
					
						commit
						4571aa7ac6
					
				
					 1 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -217,6 +217,8 @@ static struct dive dt_dive_parser(FILE *archivo, struct dive *dt_dive)
 | 
			
		|||
	 * Locality and Dive points.
 | 
			
		||||
	 */
 | 
			
		||||
	snprintf(buffer, sizeof(buffer), "%s, %s", locality, dive_point);
 | 
			
		||||
	dt_dive->dive_site_uuid = get_dive_site_uuid_by_name(buffer, NULL);
 | 
			
		||||
	if (dt_dive->dive_site_uuid == 0)
 | 
			
		||||
		dt_dive->dive_site_uuid = create_dive_site(buffer);
 | 
			
		||||
	free(locality);
 | 
			
		||||
	free(dive_point);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue