]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Fix right click edit in Dive Notes area for multiple dives
authorDirk Hohndel <dirk@hohndel.org>
Thu, 16 Aug 2012 19:48:29 +0000 (12:48 -0700)
committerDirk Hohndel <dirk@hohndel.org>
Thu, 16 Aug 2012 19:51:32 +0000 (12:51 -0700)
This fixes the bug that triggered the SIGSEGV that Linus worked around
earlier. I had forgotten to update this call path to the
edit_multi_dive_info function.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
dive.h
divelist.c
info.c
profile.c

diff --git a/dive.h b/dive.h
index eb9accb6fd4b8e10d79b18bb07e2467e2d0eb3db..b42668c168041f15e8578cf30cef27862301a42b 100644 (file)
--- a/dive.h
+++ b/dive.h
@@ -281,6 +281,7 @@ struct dive_table {
 
 extern struct dive_table dive_table;
 
+extern int *selectiontracker;
 extern int selected_dive;
 #define current_dive (get_dive(selected_dive))
 
index a85ac7c5ef3ac05eeb0e7bbe2277ff70c82acdf7..de64bd88ceecf2b30ab91831382f30ee00666d8a 100644 (file)
@@ -79,7 +79,6 @@ static void dump_model(GtkListStore *store)
 #endif
 
 static GList *selected_dives;
-static int *selectiontracker;
 
 /* when subsurface starts we want to have the last dive selected. So we simply
    walk to the first leaf (and skip the summary entries - which have negative
diff --git a/info.c b/info.c
index 6842d3d5b36b3427466629b572dbf9286fa13181..e9a08ca2a5c2f240d564dc9310e73e33126c684e 100644 (file)
--- a/info.c
+++ b/info.c
@@ -132,11 +132,12 @@ static int delete_dive_info(struct dive *dive)
 
 static void info_menu_edit_cb(GtkMenuItem *menuitem, gpointer user_data)
 {
-       edit_dive_info(current_dive);
+       edit_multi_dive_info(amount_selected, selectiontracker);
 }
 
 static void info_menu_delete_cb(GtkMenuItem *menuitem, gpointer user_data)
 {
+       /* this needs to delete all the selected dives as well, I guess? */
        delete_dive_info(current_dive);
 }
 
index 137ed6f88778c2dea942c2dd377b43dea11497d2..7a0eac4975ac9b6e4755e23236407c142f211b24 100644 (file)
--- a/profile.c
+++ b/profile.c
@@ -14,6 +14,7 @@
 #include "color.h"
 
 int selected_dive = 0;
+int *selectiontracker;
 
 typedef enum { STABLE, SLOW, MODERATE, FAST, CRAZY } velocity_t;