aboutsummaryrefslogtreecommitdiff
path: root/src/summaryview.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-03-13 06:51:44 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-03-13 06:51:44 +0000
commit43dc5a3eafdea5b911b30307620bc69d4374ddce (patch)
tree437c9912bbad531b4050983c463a2749d5615254 /src/summaryview.c
parent92677e804ff485c87db9cf34b2b9ff388916cdf9 (diff)
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
Diffstat (limited to 'src/summaryview.c')
-rw-r--r--src/summaryview.c10
1 files changed, 9 insertions, 1 deletions
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;