mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
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>
This commit is contained in:
parent
8605d68824
commit
88e679ab1d
1 changed files with 4 additions and 0 deletions
4
main.c
4
main.c
|
@ -139,6 +139,9 @@ void report_dives(void)
|
||||||
if (last && last->number)
|
if (last && last->number)
|
||||||
try_to_renumber(last, preexisting);
|
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_table.preexisting = dive_table.nr;
|
||||||
dive_list_update_dives();
|
dive_list_update_dives();
|
||||||
}
|
}
|
||||||
|
@ -184,6 +187,7 @@ void renumber_dives(int nr)
|
||||||
struct dive *dive = dive_table.dives[i];
|
struct dive *dive = dive_table.dives[i];
|
||||||
dive->number = nr + i;
|
dive->number = nr + i;
|
||||||
}
|
}
|
||||||
|
mark_divelist_changed(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
|
|
Loading…
Add table
Reference in a new issue