]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Merge git://git.tdb.fi/ext/subsurface
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 28 Aug 2012 20:16:57 +0000 (13:16 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 28 Aug 2012 20:16:57 +0000 (13:16 -0700)
Pull a few buglet fixes from Mikko Rasa.

Some trivial conflicts due to changes in the dive selection logic, and
using the new "for_each_dive()" helper.

* git://git.tdb.fi/ext/subsurface:
  Check if multi-dive editing is actually needed
  Fix an off-by-one error in buffer allocation

1  2 
gtk-gui.c
info.c

diff --cc gtk-gui.c
Simple merge
diff --cc info.c
index cccc6497b9515ea71d4087dfbb905bf74d2391f9,66e4f0adce92047a4de98bf2091604ce18d236d5..d9379ac68b200976f08c9afada59bd87f88bb736
--- 1/info.c
--- 2/info.c
+++ b/info.c
@@@ -505,10 -506,26 +506,25 @@@ int edit_multi_dive_info(struct dive *s
                NULL);
  
        vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
 -      master = get_dive(index);
 +      master = single_dive;
        if (!master)
                master = current_dive;
-       dive_info_widget(vbox, master, &info, !single_dive);
+       /* See if we should use multi dive mode */
+       multi = FALSE;
 -      if (index < 0)
 -      {
++      if (!single_dive) {
+               int i;
+               struct dive *dive;
 -              for (i = 0; (dive = get_dive(i)) != NULL; i++) {
++              for_each_dive(i, dive) {
+                       if (dive != master && dive->selected) {
+                               multi = TRUE;
+                               break;
+                       }
+               }
+       }
+       dive_info_widget(vbox, master, &info, multi);
        show_dive_equipment(master, W_IDX_SECONDARY);
        save_equipment_data(master);
        gtk_widget_show_all(dialog);