[devhelp/wip/swilmet/misc-improvements: 8/14] sidebar: use g_signal_connect_object()
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp/wip/swilmet/misc-improvements: 8/14] sidebar: use g_signal_connect_object()
- Date: Fri, 29 May 2015 14:10:17 +0000 (UTC)
commit b498ba1a198d2d973901e2b9908b687956699430
Author: Sébastien Wilmet <swilmet gnome org>
Date: Mon May 25 18:16:01 2015 +0200
sidebar: use g_signal_connect_object()
It is possible for the BookManager to live longer than the sidebar. For
example when a new main window is created, and the old one is closed.
https://bugzilla.gnome.org/show_bug.cgi?id=749797
src/dh-sidebar.c | 39 +++++++++++++++++++++++----------------
1 files changed, 23 insertions(+), 16 deletions(-)
---
diff --git a/src/dh-sidebar.c b/src/dh-sidebar.c
index f6573c3..7ff3105 100644
--- a/src/dh-sidebar.c
+++ b/src/dh-sidebar.c
@@ -613,22 +613,29 @@ dh_sidebar_constructed (GObject *object)
DhSidebarPrivate *priv = dh_sidebar_get_instance_private (sidebar);
/* Setup book manager */
- g_signal_connect (priv->book_manager,
- "book-created",
- G_CALLBACK (sidebar_book_created_or_enabled_cb),
- sidebar);
- g_signal_connect (priv->book_manager,
- "book-deleted",
- G_CALLBACK (sidebar_book_deleted_or_disabled_cb),
- sidebar);
- g_signal_connect (priv->book_manager,
- "book-enabled",
- G_CALLBACK (sidebar_book_created_or_enabled_cb),
- sidebar);
- g_signal_connect (priv->book_manager,
- "book-disabled",
- G_CALLBACK (sidebar_book_deleted_or_disabled_cb),
- sidebar);
+ g_signal_connect_object (priv->book_manager,
+ "book-created",
+ G_CALLBACK (sidebar_book_created_or_enabled_cb),
+ sidebar,
+ 0);
+
+ g_signal_connect_object (priv->book_manager,
+ "book-deleted",
+ G_CALLBACK (sidebar_book_deleted_or_disabled_cb),
+ sidebar,
+ 0);
+
+ g_signal_connect_object (priv->book_manager,
+ "book-enabled",
+ G_CALLBACK (sidebar_book_created_or_enabled_cb),
+ sidebar,
+ 0);
+
+ g_signal_connect_object (priv->book_manager,
+ "book-disabled",
+ G_CALLBACK (sidebar_book_deleted_or_disabled_cb),
+ sidebar,
+ 0);
priv->book_tree = dh_book_tree_new (priv->book_manager);
gtk_widget_show (priv->book_tree);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]