mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Add photo saving for the XML backend.
This code correctly saves the added pictures on the xml backend. next: git backend. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									33223fb2cc
								
							
						
					
					
						commit
						58f2613dae
					
				
					 1 changed files with 14 additions and 0 deletions
				
			
		
							
								
								
									
										14
									
								
								save-xml.c
									
										
									
									
									
								
							
							
						
						
									
										14
									
								
								save-xml.c
									
										
									
									
									
								
							|  | @ -369,6 +369,18 @@ static void save_dc(struct membuffer *b, struct dive *dive, struct divecomputer | ||||||
| 	put_format(b, "  </divecomputer>\n"); | 	put_format(b, "  </divecomputer>\n"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | static void save_picture(struct membuffer *b, struct picture *pic) | ||||||
|  | { | ||||||
|  | 	put_string(b, "  <picture filename='"); | ||||||
|  | 	put_string(b, pic->filename); | ||||||
|  | 	put_string(b, "'"); | ||||||
|  | 	if (pic->latitude.udeg || pic->longitude.udeg) { | ||||||
|  | 		put_degrees(b, pic->latitude, " gps='", " "); | ||||||
|  | 		put_degrees(b, pic->longitude, "", "'"); | ||||||
|  | 	} | ||||||
|  | 	put_string(b, "/>\n"); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void save_one_dive(struct membuffer *b, struct dive *dive) | void save_one_dive(struct membuffer *b, struct dive *dive) | ||||||
| { | { | ||||||
| 	struct divecomputer *dc; | 	struct divecomputer *dc; | ||||||
|  | @ -394,6 +406,8 @@ void save_one_dive(struct membuffer *b, struct dive *dive) | ||||||
| 	/* Save the dive computer data */ | 	/* Save the dive computer data */ | ||||||
| 	for_each_dc(dive, dc) | 	for_each_dc(dive, dc) | ||||||
| 		save_dc(b, dive, dc); | 		save_dc(b, dive, dc); | ||||||
|  | 	FOR_EACH_PICTURE(dive) | ||||||
|  | 		save_picture(b, picture); | ||||||
| 	put_format(b, "</dive>\n"); | 	put_format(b, "</dive>\n"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue