forked from osmocom/wireshark
Reset the temporary coloring filters to defaults instead of doing it
implicitly by calling "color_filters_init()". This should probably fix the crashes experienced when pressing ctrl-space a couple of times svn path=/trunk/; revision=23583
This commit is contained in:
parent
db2f6ce546
commit
61e7574a5c
|
@ -141,7 +141,7 @@ color_filters_find_by_name_cb(gconstpointer arg1, gconstpointer arg2)
|
|||
|
||||
/* Set the filter off a temporary colorfilters and enable it */
|
||||
void
|
||||
color_filters_set_tmp(guint8 filt_nr, gchar *filter)
|
||||
color_filters_set_tmp(guint8 filt_nr, gchar *filter, gboolean disabled)
|
||||
{
|
||||
gchar *name = NULL;
|
||||
GSList *cfl;
|
||||
|
@ -164,13 +164,25 @@ color_filters_set_tmp(guint8 filt_nr, gchar *filter)
|
|||
dfilter_free(colorf->c_colorfilter);
|
||||
colorf->filter_text = g_strdup(filter);
|
||||
colorf->c_colorfilter = compiled_filter;
|
||||
colorf->disabled = FALSE;
|
||||
colorf->disabled = disabled;
|
||||
}
|
||||
}
|
||||
g_free(name);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Reset the temporary colorfilters */
|
||||
void
|
||||
color_filters_reset_tmp()
|
||||
{
|
||||
guint8 i;
|
||||
|
||||
for ( i=1 ; i<=10 ; i++ ) {
|
||||
color_filters_set_tmp(i, "frame", TRUE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* delete the specified filter */
|
||||
void
|
||||
color_filter_delete(color_filter_t *colorf)
|
||||
|
|
|
@ -70,9 +70,16 @@ color_filters_enable(gboolean enable);
|
|||
*
|
||||
* @param filt_nr a number 1-10 pointing to a temporary color
|
||||
* @param filter the new filter-string
|
||||
* @param disabled whether the filter-rule should be disabled
|
||||
*/
|
||||
void
|
||||
color_filters_set_tmp(guint8 filt_nr, gchar *filter);
|
||||
color_filters_set_tmp(guint8 filt_nr, gchar *filter, gboolean disabled);
|
||||
|
||||
/** Reset the temporary color filters
|
||||
*
|
||||
*/
|
||||
void
|
||||
color_filters_reset_tmp();
|
||||
|
||||
/* Prime the epan_dissect_t with all the compiler
|
||||
* color filters of the current filter list.
|
||||
|
|
|
@ -363,9 +363,9 @@ colorize_selected_ptree_cb(GtkWidget *w _U_, gpointer data _U_, guint8 filt_nr)
|
|||
color_display_with_filter(filter);
|
||||
} else {
|
||||
if (filt_nr==255) {
|
||||
color_filters_init();
|
||||
color_filters_reset_tmp();
|
||||
} else {
|
||||
color_filters_set_tmp(filt_nr,filter);
|
||||
color_filters_set_tmp(filt_nr,filter, FALSE);
|
||||
}
|
||||
cf_colorize_packets(&cfile);
|
||||
}
|
||||
|
|
|
@ -386,7 +386,7 @@ colorize_conversation_cb(GtkWidget * w _U_, gpointer data _U_, int action)
|
|||
gchar *filter = NULL;
|
||||
|
||||
if( (action>>8) == 255 ) {
|
||||
color_filters_init();
|
||||
color_filters_reset_tmp();
|
||||
cf_colorize_packets(&cfile);
|
||||
} else {
|
||||
if( (action&0xff) == 0 ) {
|
||||
|
@ -415,7 +415,7 @@ colorize_conversation_cb(GtkWidget * w _U_, gpointer data _U_, int action)
|
|||
color_display_with_filter(filter);
|
||||
} else {
|
||||
/* Set one of the temporary coloring filters */
|
||||
color_filters_set_tmp((guint8)(action>>8),filter);
|
||||
color_filters_set_tmp((guint8)(action>>8),filter,FALSE);
|
||||
cf_colorize_packets(&cfile);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue