diff options
author | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-08-25 03:01:32 +0000 |
---|---|---|
committer | gerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-08-25 03:01:32 +0000 |
commit | 31618ca313763a11c80b8686008b82ea5772a06a (patch) | |
tree | e38dda0cdc6ebda7aef8f77cb269e5d2f6ecfa2d /gtk/file_dlg.c | |
parent | 74fdeefce53f6752c1279c857d6edd36d7d30439 (diff) |
Move the file-reloading code from gtk/file_dlg.c to file.c.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11823 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk/file_dlg.c')
-rw-r--r-- | gtk/file_dlg.c | 47 |
1 files changed, 1 insertions, 46 deletions
diff --git a/gtk/file_dlg.c b/gtk/file_dlg.c index f71e2ac6f0..73dff5a8b0 100644 --- a/gtk/file_dlg.c +++ b/gtk/file_dlg.c @@ -1438,52 +1438,7 @@ file_save_as_destroy_cb(GtkWidget *win _U_, gpointer user_data _U_) /* Reload a file using the current read and display filters */ void file_reload_cmd_cb(GtkWidget *w _U_, gpointer data _U_) { - gchar *filename; - gboolean is_tempfile; - - /* If the file could be opened, "cf_open()" calls "cf_close()" - to get rid of state for the old capture file before filling in state - for the new capture file. "cf_close()" will remove the file if - it's a temporary file; we don't want that to happen (for one thing, - it'd prevent subsequent reopens from working). Remember whether it's - a temporary file, mark it as not being a temporary file, and then - reopen it as the type of file it was. - - Also, "cf_close()" will free "cfile.filename", so we must make - a copy of it first. */ - filename = g_strdup(cfile.filename); - is_tempfile = cfile.is_tempfile; - cfile.is_tempfile = FALSE; - if (cf_open(filename, is_tempfile, &cfile) == 0) { - switch (cf_read(&cfile)) { - - case READ_SUCCESS: - case READ_ERROR: - /* Just because we got an error, that doesn't mean we were unable - to read any of the file; we handle what we could get from the - file. */ - break; - - case READ_ABORTED: - /* The user bailed out of re-reading the capture file; the - capture file has been closed - just free the capture file name - string and return (without changing the last containing - directory). */ - g_free(filename); - return; - } - } else { - /* The open failed, so "cfile.is_tempfile" wasn't set to "is_tempfile". - Instead, the file was left open, so we should restore "cfile.is_tempfile" - ourselves. - - XXX - change the menu? Presumably "cf_open()" will do that; - make sure it does! */ - cfile.is_tempfile = is_tempfile; - } - /* "cf_open()" made a copy of the file name we handed it, so - we should free up our copy. */ - g_free(filename); + cf_reload(); } /******************** Color Filters *********************************/ |