From: Linus Torvalds Date: Wed, 5 Oct 2011 15:06:48 +0000 (-0700) Subject: Move 'dive_list_update_dives()' call into 'report_dives()' X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=f4820455e2019c1a9deba7e90ed7f06111a4cb39;p=ext%2Fsubsurface.git Move 'dive_list_update_dives()' call into 'report_dives()' All the callers were always calling report_dives first, followed by dive_list_update_dives(). And there really was no reason to have the callers call two separate functions for the "I've added new dives" case. So just call dive_list_update_dives() directly from report_dives(), and remove it from the callers. Signed-off-by: Linus Torvalds --- diff --git a/gtk-gui.c b/gtk-gui.c index d6ab412..cecfb72 100644 --- a/gtk-gui.c +++ b/gtk-gui.c @@ -130,7 +130,6 @@ static void file_open(GtkWidget *w, gpointer data) } g_slist_free(filenames); report_dives(); - dive_list_update_dives(); } gtk_widget_destroy(dialog); } @@ -881,7 +880,6 @@ void import_dialog(GtkWidget *w, gpointer data) gtk_widget_destroy(dialog); report_dives(); - dive_list_update_dives(); } void update_progressbar(progressbar_t *progress, double value) diff --git a/main.c b/main.c index 92eb9ee..d259b38 100644 --- a/main.c +++ b/main.c @@ -76,6 +76,8 @@ void report_dives(void) /* Redo the new 'i'th dive */ i--; } + + dive_list_update_dives(); } static void parse_argument(const char *arg) @@ -150,7 +152,6 @@ int main(int argc, char **argv) } report_dives(); - dive_list_update_dives(); run_ui(); return 0;