[PATCH] Do not reorder pictures when saving

Miika Turkia miika.turkia at gmail.com
Mon Feb 2 08:45:56 PST 2015


When one has 2 pictures with the same timestamp, these pictures are
reordered on saving (requires something changed on the specific dive for
the save to actually trigger). This patch keeps the picture order intact
in the XML log.

Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
---
 dive.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dive.c b/dive.c
index ce7619e..7b3ab21 100644
--- a/dive.c
+++ b/dive.c
@@ -2870,7 +2870,7 @@ void dive_add_picture(struct dive *d, struct picture *newpic)
 {
 	struct picture **pic_ptr = &d->picture_list;
 	/* let's keep the list sorted by time */
-	while (*pic_ptr && (*pic_ptr)->offset.seconds < newpic->offset.seconds)
+	while (*pic_ptr && (*pic_ptr)->offset.seconds <= newpic->offset.seconds)
 		pic_ptr = &(*pic_ptr)->next;
 	newpic->next = *pic_ptr;
 	*pic_ptr = newpic;
-- 
1.9.1



More information about the subsurface mailing list