From 43dc5a3eafdea5b911b30307620bc69d4374ddce Mon Sep 17 00:00:00 2001 From: hiro Date: Tue, 13 Mar 2007 06:51:44 +0000 Subject: fixed crash on exit when the order of summary columns were changed by DnD. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1564 ee746299-78ed-0310-b773-934348b2243d --- src/summaryview.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/summaryview.c') diff --git a/src/summaryview.c b/src/summaryview.c index 57142c81..1872fa82 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -4967,6 +4967,8 @@ static GtkWidget *summary_tree_view_create(SummaryView *summaryview) g_object_set(renderer, "xalign", align, "ypad", 0, NULL); \ column = gtk_tree_view_column_new_with_attributes \ (title, renderer, # type , col, NULL); \ + g_object_set_data(G_OBJECT(column), "column_id", \ + GINT_TO_POINTER(col)); \ summaryview->columns[col] = column; \ if (text_attr) { \ gtk_tree_view_column_set_attributes \ @@ -5106,7 +5108,13 @@ void summary_get_column_order(SummaryView *summaryview) for (cur = columns; cur != NULL && pos < N_SUMMARY_VISIBLE_COLS; cur = cur->next, pos++) { column = (GtkTreeViewColumn *)cur->data; - type = gtk_tree_view_column_get_sort_column_id(column); + type = GPOINTER_TO_INT + (g_object_get_data(G_OBJECT(column), "column_id")); + if (type < 0 || type >= N_SUMMARY_VISIBLE_COLS) { + g_warning("summary_get_column_order: " + "invalid type: %d\n", type); + break; + } visible = gtk_tree_view_column_get_visible(column); summaryview->col_state[pos].type = type; summaryview->col_state[pos].visible = visible; -- cgit v1.2.3