aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.ja5
-rw-r--r--src/summaryview.c10
3 files changed, 19 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d02e24e6..591ac781 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-03-13
+
+ * src/summaryview.c: fixed crash on exit when the order of summary
+ columns were changed by DnD.
+
2007-03-02
* src/printing.c: printing_print_messages_gtk(): made the default
diff --git a/ChangeLog.ja b/ChangeLog.ja
index 9e8fc605..e3586d75 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,3 +1,8 @@
+2007-03-13
+
+ * src/summaryview.c: サマリのカラムの順序を DnD で変更した場合
+ 終了時にクラッシュするのを修正。
+
2007-03-02
* src/printing.c: printing_print_messages_gtk(): 印刷ダイアログ
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;