summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2011-10-05 09:24:52 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2011-10-05 09:24:52 -0700
commit88e679ab1df89b2b14f40f4566095d5a01439c05 (patch)
tree1df21d2f634b186fa585cd7b2a99aa4482163623 /main.c
parent8605d68824042390b858c4ee9b9afdc6844ab312 (diff)
downloadsubsurface-88e679ab1df89b2b14f40f4566095d5a01439c05.tar.gz
Mark divelist changed when renumbering or adding dives
The behavior is not yet consistent when calling with multiple file names on the command line (as we don't add number to the later ones in this case), but at least it catches the case if you manually renumber the dives or if you import new dives that get added at the end - which are the two most typical cases. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.c b/main.c
index be52dbd97..a09bfe03a 100644
--- a/main.c
+++ b/main.c
@@ -139,6 +139,9 @@ void report_dives(void)
if (last && last->number)
try_to_renumber(last, preexisting);
+ /* did we have dives in the table and added more? */
+ if (last && preexisting != dive_table.nr)
+ mark_divelist_changed(TRUE);
dive_table.preexisting = dive_table.nr;
dive_list_update_dives();
}
@@ -184,6 +187,7 @@ void renumber_dives(int nr)
struct dive *dive = dive_table.dives[i];
dive->number = nr + i;
}
+ mark_divelist_changed(TRUE);
}
int main(int argc, char **argv)