[nautilus] directory-background: don't user the 'destroy' signal of EelBackground



commit fbb6b024128e3c35aeb1d74f8e287e8870c9999f
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Sep 29 02:07:46 2010 +0200

    directory-background: don't user the 'destroy' signal of EelBackground

 .../nautilus-directory-background.c                |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/libnautilus-private/nautilus-directory-background.c b/libnautilus-private/nautilus-directory-background.c
index 5568078..7cdad60 100644
--- a/libnautilus-private/nautilus-directory-background.c
+++ b/libnautilus-private/nautilus-directory-background.c
@@ -226,15 +226,16 @@ call_settings_changed (EelBackground *background)
 }
 
 static void
-desktop_background_destroyed_callback (EelBackground *background, void *georgeWBush)
+desktop_background_weak_notify (gpointer data,
+                                GObject *object)
 {
         guint notification_id;
         guint notification_timeout_id;
 
-        notification_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (background), "desktop_gconf_notification"));
+        notification_id = GPOINTER_TO_UINT (g_object_get_data (object, "desktop_gconf_notification"));
         gconf_client_notify_remove (nautilus_gconf_client, notification_id);
 
-        notification_timeout_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (background), "desktop_gconf_notification_timeout"));
+        notification_timeout_id = GPOINTER_TO_UINT (g_object_get_data (object, "desktop_gconf_notification_timeout"));
         if (notification_timeout_id != 0) {
                 g_source_remove (notification_timeout_id);
         }
@@ -275,8 +276,8 @@ nautilus_file_background_receive_gconf_changes (EelBackground *background)
 
         g_object_set_data (G_OBJECT (background), "desktop_gconf_notification", GUINT_TO_POINTER (notification_id));
 
-        g_signal_connect (background, "destroy",
-                          G_CALLBACK (desktop_background_destroyed_callback), NULL);
+        g_object_weak_ref (G_OBJECT (background),
+                           desktop_background_weak_notify, NULL);
 }
 
 /* handle the background changed signal */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]