From 8aa10d0c9037d2a85c4d988008bb17469f5f6154 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Sun, 1 Jul 2007 08:45:11 +0000 Subject: [PATCH] Do not connect selection changed signal more than once. Fixes bug #349433. 2007-07-01 Carlos Garcia Campos * shell/ev-sidebar-links.c: (job_finished_callback): Do not connect selection changed signal more than once. Fixes bug #349433. svn path=/trunk/; revision=2531 --- ChangeLog | 7 +++++++ shell/ev-sidebar-links.c | 24 ++++++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index c8d60d24..d75c200d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-07-01 Carlos Garcia Campos + + * shell/ev-sidebar-links.c: (job_finished_callback): + + Do not connect selection changed signal more than once. Fixes bug + #349433. + 2007-06-29 Carlos Garcia Campos * shell/ev-window.c: (ev_window_view_sidebar_cb): diff --git a/shell/ev-sidebar-links.c b/shell/ev-sidebar-links.c index 5d346954..cbe19b1b 100644 --- a/shell/ev-sidebar-links.c +++ b/shell/ev-sidebar-links.c @@ -593,7 +593,7 @@ row_activated_callback (GtkTreeView *treeview, GtkTreePath *arg1, GtkTreeViewColumn *arg2, gpointer user_data) -{ +{ if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (treeview), arg1)) { gtk_tree_view_collapse_row (GTK_TREE_VIEW (treeview), arg1); } else { @@ -648,18 +648,26 @@ job_finished_callback (EvJobLinks *job, selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->tree_view)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - priv->selection_id = g_signal_connect (selection, "changed", - G_CALLBACK (selection_changed_callback), - sidebar_links); - priv->page_changed_id = g_signal_connect (priv->page_cache, "page-changed", + + if (priv->selection_id <= 0) { + priv->selection_id = + g_signal_connect (selection, "changed", + G_CALLBACK (selection_changed_callback), + sidebar_links); + } + priv->page_changed_id = g_signal_connect (priv->page_cache, "page-changed", G_CALLBACK (update_page_callback), sidebar_links); - priv->row_activated_id = g_signal_connect (G_OBJECT (priv->tree_view), "row-activated", - G_CALLBACK (row_activated_callback), sidebar_links); + if (priv->row_activated_id <= 0) { + priv->row_activated_id = + g_signal_connect (G_OBJECT (priv->tree_view), "row-activated", + G_CALLBACK (row_activated_callback), + sidebar_links); + } + update_page_callback (priv->page_cache, ev_page_cache_get_current_page (priv->page_cache), sidebar_links); - } static void -- 2.43.5