}
}
+/*
+ * track whether we switched to importing dives
+ */
+static gboolean imported = FALSE;
+
/*
* This doesn't really report anything at all. We just sort the
* dives, the GUI does the reporting
*/
-void report_dives(void)
+void report_dives(gboolean imported)
{
int i;
int preexisting = dive_table.preexisting;
i--;
}
- /* Was the previous dive table state numbered? */
- if (last && last->number)
- try_to_renumber(last, preexisting);
+ if (imported) {
+ /* Was the previous dive table state numbered? */
+ 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);
+ /* 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();
}
if (strcmp(arg,"--import") == 0) {
/* mark the dives so far as the base,
* everything after is imported */
- report_dives();
+ report_dives(FALSE);
+ imported = TRUE;
return;
}
/* fallthrough */
}
}
- report_dives();
+ report_dives(imported);
run_ui();
return 0;