diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-05-03 03:24:47 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-05-03 03:24:47 +0000 |
commit | 433e8801a1c5f0d3eaac100132ebaf19d152b434 (patch) | |
tree | 571fc1d177cb6a6d4d0011d487e464a48080c06f /gtk/keys.h | |
parent | 0705d7ff0b8bec8bd127e379f62ea20cdf364ee4 (diff) |
Clean up the handling of filter strings:
have "filter_packets()" make a copy of the filter string handed
to it, as it may save the filter string in the "capture_file"
structure, and the caller of "filter_packets()" shouldn't have
to worry about the string it passed to "filter_packets()" being
stashed away somewhere so that it can't just free that string or
change it;
have callers of "filter_packets()" free up the string they
handed to it, if the string was allocated and they're done with
it;
plug some memory leaks in "match_selected_cb_do()".
Check for an illegal "action" argument being passed to
"match_selected_cb_do()".
Move some keys out of "keys.h" into "gtk/main.c", as they're only used
in "gtk/main.c".
Make the pointer to the filter list a data item for the combo box, as
it's a copy of the list of strings for the combo box, rather than
attaching it to the widgets that activate the filter (a pointer to the
combo box *itself* is a data item for those widgets).
In "filter_activate_cb()", make a copy of the text from the text entry
field as soon as we fetch it, and use that copy. Free that copy if
we didn't add the filter to the filter list.
Don't make a copy of the entire filter list and use that to set the
combo box's list of items - just use the list itself. Also, when the
list is changed, make the new value the data for the combo box (the list
pointer will actually not be changed, because we happen to be using
"g_list_append()", but let's not rely on that).
svn path=/trunk/; revision=5368
Diffstat (limited to 'gtk/keys.h')
-rw-r--r-- | gtk/keys.h | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/gtk/keys.h b/gtk/keys.h index d4686fe9a9..aaf788a2f6 100644 --- a/gtk/keys.h +++ b/gtk/keys.h @@ -1,12 +1,11 @@ /* keys.h * Key definitions for various objects * - * $Id: keys.h,v 1.12 2002/01/11 08:21:02 guy Exp $ + * $Id: keys.h,v 1.13 2002/05/03 03:24:47 guy Exp $ * * Ethereal - Network traffic analyzer - * By Gerald Combs <gerald@zing.org> + * By Gerald Combs <gerald@ethereal.com> * Copyright 1998 Gerald Combs - * * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -29,8 +28,6 @@ /* Keys for gtk_object_set_data */ #define E_DFILTER_TE_KEY "display_filter_entry" -#define E_DFILTER_CM_KEY "display_filter_combo" -#define E_DFILTER_FL_KEY "display_filter_list" #define E_RFILTER_TE_KEY "read_filter_te" #define E_MPACKET_LIST_KEY "menu_packet_list" #define E_MPACKET_LIST_ROW_KEY "menu_packet_list_row" |