From 23b2341a9ba84d042d409132019b9203ea597549 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 6 Aug 2005 18:40:03 +0000 Subject: We no longer generate a "Loading" message ourselves, we just pass the name of the file being loaded to "delayed_create_progress_dlg()". Get rid of the pointless "g_strdup_printf()" call (which amounted to a more-expensive "g_strdup()", and the variables it used. svn path=/trunk/; revision=15248 --- file.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index b9960e7bdf..b278ba2fb4 100644 --- a/file.c +++ b/file.c @@ -331,7 +331,6 @@ cf_read(capture_file *cf) int err; gchar *err_info; const gchar *name_ptr; - const gchar *load_msg, *load_fmt = "%s"; const char *errmsg; char errmsg_errno[1024+1]; gchar err_str[2048+1]; @@ -360,7 +359,6 @@ cf_read(capture_file *cf) cf_callback_invoke(cf_cb_file_read_start, cf); name_ptr = get_basename(cf->filename); - load_msg = g_strdup_printf(load_fmt, name_ptr); /* Update the progress bar when it gets to this value. */ progbar_nextstep = 0; @@ -399,10 +397,8 @@ cf_read(capture_file *cf) } if (progbar == NULL) { /* Create the progress bar if necessary */ - progbar = delayed_create_progress_dlg("Loading", load_msg, + progbar = delayed_create_progress_dlg("Loading", name_ptr, &stop_flag, &start_time, prog_val); - if (progbar != NULL) - g_free(load_msg); } if (progbar != NULL) { g_snprintf(status_str, sizeof(status_str), @@ -426,9 +422,7 @@ cf_read(capture_file *cf) } /* We're done reading the file; destroy the progress bar if it was created. */ - if (progbar == NULL) - g_free(load_msg); - else + if (progbar != NULL) destroy_progress_dlg(progbar); /* We're done reading sequentially through the file. */ -- cgit v1.2.3