Fixed adding new columns from preferences.

svn path=/trunk/; revision=31091
This commit is contained in:
Stig Bjørlykke 2009-11-26 21:41:14 +00:00
parent 5fa9b50863
commit 97cbb07e58
1 changed files with 9 additions and 5 deletions

View File

@ -274,11 +274,15 @@ column_prefs_add_custom(gint fmt, const gchar *title, const gchar *custom_field)
cfmt->fmt = g_strdup(col_format_to_string(fmt));
cfmt->custom_field = g_strdup(custom_field);
clp = g_list_last(prefs.col_list);
last_cfmt = (fmt_data *) clp->data;
if (strcmp(last_cfmt->fmt, "%i") == 0) {
/* Last column is COL_INFO, add custom column before this */
prefs.col_list = g_list_insert(prefs.col_list, cfmt, g_list_length(prefs.col_list)-1);
if (custom_field) {
clp = g_list_last(prefs.col_list);
last_cfmt = (fmt_data *) clp->data;
if (strcmp(last_cfmt->fmt, "%i") == 0) {
/* Last column is COL_INFO, add custom column before this */
prefs.col_list = g_list_insert(prefs.col_list, cfmt, g_list_length(prefs.col_list)-1);
} else {
prefs.col_list = g_list_append(prefs.col_list, cfmt);
}
} else {
prefs.col_list = g_list_append(prefs.col_list, cfmt);
}