Check for custom column before using custom_field.

Store hidden columns correctly.

svn path=/trunk/; revision=33288
This commit is contained in:
Stig Bjørlykke 2010-06-22 13:40:28 +00:00
parent 017e4d0dc0
commit 2e5c2b805f
2 changed files with 4 additions and 3 deletions

View File

@ -3015,7 +3015,7 @@ write_prefs(char **pf_path_return)
}
if (!cfmt->visible) {
if (strlen (cols_hidden->str)) {
g_string_append (cols_hidden, ", ");
g_string_append (cols_hidden, ",");
}
g_string_append (cols_hidden, prefs_fmt);
}

View File

@ -3351,7 +3351,7 @@ rebuild_visible_columns_menu (void)
GList *clp;
fmt_data *cfmt;
gchar *title;
gint i, col_id;
gint i, col_id, cur_fmt;
menu_columns[0] = gtk_item_factory_get_widget(main_menu_factory, "/View/Displayed Columns");
menu_columns[1] = gtk_item_factory_get_widget(packet_list_heading_factory, "/Displayed Columns");
@ -3364,7 +3364,8 @@ rebuild_visible_columns_menu (void)
col_id = 0;
while (clp) {
cfmt = (fmt_data *) clp->data;
if (cfmt->custom_field) {
cur_fmt = get_column_format_from_str(cfmt->fmt);
if (cur_fmt == COL_CUSTOM) {
title = g_strdup_printf ("%s (%s)", cfmt->title, cfmt->custom_field);
} else {
title = g_strdup_printf ("%s (%s)", cfmt->title, col_format_desc(cfile.cinfo.col_fmt[col_id]));