From 499799e1c07f4bd4e7d75318296fa2fe242352db Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Thu, 15 Dec 2005 18:39:54 +0000 Subject: [PATCH] r4262: Bugfix: Changing the display style crashes the filer with GTK >= 2.8.9 because it sends a selection changed event before the view has finished initialising (Thomas Leonard; reported by Tobias Kieslich). --- ROX-Filer/Help/Changes | 6 ++++++ ROX-Filer/src/filer.c | 2 ++ ROX-Filer/src/toolbar.c | 2 ++ ROX-Filer/src/view_details.c | 7 +++++-- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ROX-Filer/Help/Changes b/ROX-Filer/Help/Changes index fc7f9d14..90f041dd 100644 --- a/ROX-Filer/Help/Changes +++ b/ROX-Filer/Help/Changes @@ -2,6 +2,12 @@ A RISC OS-like filer for X by Thomas Leonard +15-Dec-2005 +~~~~~~~~~~~ +Bugfix: Changing the display style crashes the filer with GTK >= 2.8.9 because + it sends a selection changed event before the view has finished + initialising (Thomas Leonard; reported by Tobias Kieslich). + 13-Dec-2005 (Release 2.4) ~~~~~~~~~~~ Updated Chinese translations (Babyfai Cheung). diff --git a/ROX-Filer/src/filer.c b/ROX-Filer/src/filer.c index f57ca276..e5db183a 100644 --- a/ROX-Filer/src/filer.c +++ b/ROX-Filer/src/filer.c @@ -765,6 +765,8 @@ static void selection_get(GtkWidget *widget, */ void filer_selection_changed(FilerWindow *filer_window, gint time) { + g_return_if_fail(filer_window != NULL); + toolbar_update_info(filer_window); if (window_with_primary == filer_window) diff --git a/ROX-Filer/src/toolbar.c b/ROX-Filer/src/toolbar.c index 7846d3d2..5456412f 100644 --- a/ROX-Filer/src/toolbar.c +++ b/ROX-Filer/src/toolbar.c @@ -184,6 +184,8 @@ void toolbar_update_info(FilerWindow *filer_window) ViewIface *view; int n_selected; + g_return_if_fail(filer_window != NULL); + if (o_toolbar.int_value == TOOLBAR_NONE || !o_toolbar_info.int_value) return; /* Not showing info */ diff --git a/ROX-Filer/src/view_details.c b/ROX-Filer/src/view_details.c index 2b0474e7..a89f7a81 100644 --- a/ROX-Filer/src/view_details.c +++ b/ROX-Filer/src/view_details.c @@ -990,14 +990,17 @@ static void view_details_init(GTypeInstance *object, gpointer gclass) GTK_SELECTION_MULTIPLE); gtk_tree_selection_set_select_function(view_details->selection, test_can_change_selection, view_details, NULL); - g_signal_connect(view_details->selection, "changed", - G_CALLBACK(selection_changed), view_details); /* Sorting */ view_details->sort_fn = NULL; sortable_list = GTK_TREE_SORTABLE(object); gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(view_details)); + /* Do this after set_model, because that can generate this + * signal... + */ + g_signal_connect(view_details->selection, "changed", + G_CALLBACK(selection_changed), view_details); /* Icon */ cell = cell_icon_new(view_details); -- 2.11.4.GIT