diff options
author | Martin Wehner <martin.wehner@gmail.com> | 2006-12-18 20:53:38 +0000 |
---|---|---|
committer | Martin Wehner <mwehner@src.gnome.org> | 2006-12-18 20:53:38 +0000 |
commit | 201012e61db45110360ca37e4093600273df9c13 (patch) | |
tree | 321a1c86de9f5888379e12a3d0b01f19e112a23c | |
parent | 829261f6d0cd30e15ba7be32a588ff7c387e323b (diff) | |
download | nautilus-201012e61db45110360ca37e4093600273df9c13.tar.gz |
Don't connect the changed signal handler on the view as combobox each time
2006-12-18 Martin Wehner <martin.wehner@gmail.com>
* src/nautilus-navigation-window.c:
(nautilus_navigation_window_instance_init), (load_view_as_menu):
Don't connect the changed signal handler on the view as combobox
each time the contents of the combobox are reloaded, but only on
instantiation. Prevents creating as many view instances as times
the view/location was already changed when using the view as menu.
(This is a pretty bad bug and possibly the cause of many of the
strange crashes we've been getting over the last year. It'd also
explain why most of these bugs almost exlusively occurred on Ubuntu,
as they use browser mode per default).
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | src/nautilus-navigation-window.c | 8 |
2 files changed, 18 insertions, 3 deletions
@@ -1,3 +1,16 @@ +2006-12-18 Martin Wehner <martin.wehner@gmail.com> + + * src/nautilus-navigation-window.c: + (nautilus_navigation_window_instance_init), (load_view_as_menu): + Don't connect the changed signal handler on the view as combobox + each time the contents of the combobox are reloaded, but only on + instantiation. Prevents creating as many view instances as times + the view/location was already changed when using the view as menu. + (This is a pretty bad bug and possibly the cause of many of the + strange crashes we've been getting over the last year. It'd also + explain why most of these bugs almost exlusively occurred on Ubuntu, + as they use browser mode per default). + 2006-12-04 Alexander Larsson <alexl@redhat.com> * cut-n-paste-code/gsequence/gsequence.[ch]: diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c index ace142453..625126e7f 100644 --- a/src/nautilus-navigation-window.c +++ b/src/nautilus-navigation-window.c @@ -136,6 +136,9 @@ static void search_bar_cancel_callback (GtkWidget * static void nautilus_navigation_window_show_location_bar_temporarily (NautilusNavigationWindow *window); +static void view_as_menu_switch_views_callback (GtkComboBox *combo_box, + NautilusWindow *window); + GNOME_CLASS_BOILERPLATE (NautilusNavigationWindow, nautilus_navigation_window, NautilusWindow, NAUTILUS_TYPE_WINDOW) @@ -312,6 +315,8 @@ nautilus_navigation_window_instance_init (NautilusNavigationWindow *window) window->view_as_combo_box = gtk_combo_box_new_text (); gtk_box_pack_end (GTK_BOX (view_as_menu_vbox), window->view_as_combo_box, TRUE, FALSE, 0); gtk_widget_show (window->view_as_combo_box); + g_signal_connect_object (window->view_as_combo_box, "changed", + G_CALLBACK (view_as_menu_switch_views_callback), window, 0); /* Allocate the zoom control and place on the right next to the menu. * It gets shown later, if the view-frame contains something zoomable. @@ -877,9 +882,6 @@ load_view_as_menu (NautilusWindow *window) selected_index = index; } - g_signal_connect (GTK_COMBO_BOX (NAUTILUS_NAVIGATION_WINDOW (window)->view_as_combo_box), - "changed", G_CALLBACK (view_as_menu_switch_views_callback), window); - gtk_combo_box_set_active (GTK_COMBO_BOX (NAUTILUS_NAVIGATION_WINDOW (window)->view_as_combo_box), selected_index); } |