aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-06-26 04:03:31 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-06-26 04:03:31 +0000
commitbbb842cbedd45a3952496bb616c0e88a0416f6a9 (patch)
tree79758be4617671e28a8965ff4b5a89994cbd9574 /src
parentb91745127a6333b9b8a809bc79e21b297aef4598 (diff)
made workarounds for the crash in GTK+ 2.8.x.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1089 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/gtkutils.c13
-rw-r--r--src/gtkutils.h4
-rw-r--r--src/summaryview.c16
3 files changed, 22 insertions, 11 deletions
diff --git a/src/gtkutils.c b/src/gtkutils.c
index 691c3712..8898f029 100644
--- a/src/gtkutils.c
+++ b/src/gtkutils.c
@@ -623,6 +623,19 @@ void gtkut_tree_view_scroll_to_cell(GtkTreeView *treeview, GtkTreePath *path,
gtk_tree_view_scroll_to_point(treeview, dest_x, dest_y);
}
+void gtkut_tree_view_fast_clear(GtkTreeView *treeview, GtkTreeStore *store)
+{
+#if GTK_CHECK_VERSION(2, 8, 0)
+ gtk_tree_store_clear(store);
+#else
+ /* this is faster than above, but it seems to trigger crashes in
+ GTK+ 2.8.x */
+ gtk_tree_view_set_model(treeview, NULL);
+ gtk_tree_store_clear(store);
+ gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(store));
+#endif
+}
+
void gtkut_combo_set_items(GtkCombo *combo, const gchar *str1, ...)
{
va_list args;
diff --git a/src/gtkutils.h b/src/gtkutils.h
index 15872de2..ebc9bfed 100644
--- a/src/gtkutils.h
+++ b/src/gtkutils.h
@@ -32,6 +32,7 @@
#include <gtk/gtkeditable.h>
#include <gtk/gtkctree.h>
#include <gtk/gtktreemodel.h>
+#include <gtk/gtktreestore.h>
#include <gtk/gtktreeview.h>
#include <gtk/gtkcombo.h>
#include <gtk/gtkscrolledwindow.h>
@@ -163,6 +164,9 @@ void gtkut_tree_view_scroll_to_cell (GtkTreeView *treeview,
GtkTreePath *path,
gboolean align_center);
+void gtkut_tree_view_fast_clear (GtkTreeView *treeview,
+ GtkTreeStore *store);
+
void gtkut_combo_set_items (GtkCombo *combo,
const gchar *str1, ...);
diff --git a/src/summaryview.c b/src/summaryview.c
index b620f6a1..44dfd51b 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -940,9 +940,7 @@ void summary_clear_list(SummaryView *summaryview)
procmsg_msg_list_free(summaryview->all_mlist);
summaryview->all_mlist = NULL;
- gtk_tree_view_set_model(treeview, NULL);
- gtk_tree_store_clear(summaryview->store);
- gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(summaryview->store));
+ gtkut_tree_view_fast_clear(treeview, summaryview->store);
/* ensure that the "value-changed" signal is always emitted */
adj = gtk_tree_view_get_vadjustment(treeview);
@@ -5073,10 +5071,8 @@ void summary_qsearch_reset(SummaryView *summaryview)
messageview_clear(summaryview->messageview);
- gtk_tree_view_set_model(GTK_TREE_VIEW(summaryview->treeview), NULL);
- gtk_tree_store_clear(summaryview->store);
- gtk_tree_view_set_model(GTK_TREE_VIEW(summaryview->treeview),
- GTK_TREE_MODEL(summaryview->store));
+ gtkut_tree_view_fast_clear(GTK_TREE_VIEW(summaryview->treeview),
+ summaryview->store);
gtkut_tree_sortable_unset_sort_column_id
(GTK_TREE_SORTABLE(summaryview->store));
summaryview->total_size = 0;
@@ -5196,10 +5192,8 @@ void summary_qsearch(SummaryView *summaryview)
(GSignalMatchType)G_SIGNAL_MATCH_DATA,
0, 0, NULL, NULL, summaryview);
- gtk_tree_view_set_model(GTK_TREE_VIEW(summaryview->treeview), NULL);
- gtk_tree_store_clear(summaryview->store);
- gtk_tree_view_set_model(GTK_TREE_VIEW(summaryview->treeview),
- GTK_TREE_MODEL(summaryview->store));
+ gtkut_tree_view_fast_clear(GTK_TREE_VIEW(summaryview->treeview),
+ summaryview->store);
gtkut_tree_sortable_unset_sort_column_id
(GTK_TREE_SORTABLE(summaryview->store));
summaryview->total_size = 0;