diff options
author | Alexander Larsson <alexl@redhat.com> | 2008-02-08 13:09:06 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2008-02-08 13:09:06 +0000 |
commit | 97b7f15a5904cfe08a037e2e310dc659102e45e0 (patch) | |
tree | b0811615b1c999bc827d2c1455249be52f35bbd5 /libnautilus-private/nautilus-desktop-link.c | |
parent | 912b9d3eba46fc757376d27dd7adbb3350762d56 (diff) | |
download | nautilus-97b7f15a5904cfe08a037e2e310dc659102e45e0.tar.gz |
Handle changes of GMount objects
2008-02-08 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-desktop-link.c:
(mount_changed_callback):
(nautilus_desktop_link_new_from_mount):
Handle changes of GMount objects
svn path=/trunk/; revision=13711
Diffstat (limited to 'libnautilus-private/nautilus-desktop-link.c')
-rw-r--r-- | libnautilus-private/nautilus-desktop-link.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libnautilus-private/nautilus-desktop-link.c b/libnautilus-private/nautilus-desktop-link.c index d8d06c595..ddc6d04e6 100644 --- a/libnautilus-private/nautilus-desktop-link.c +++ b/libnautilus-private/nautilus-desktop-link.c @@ -69,6 +69,24 @@ nautilus_desktop_link_changed (NautilusDesktopLink *link) } static void +mount_changed_callback (GMount *mount, NautilusDesktopLink *link) +{ + g_free (link->details->display_name); + if (link->details->activation_location) { + g_object_unref (link->details->activation_location); + } + if (link->details->icon) { + g_object_unref (link->details->icon); + } + + link->details->display_name = g_mount_get_name (mount); + link->details->activation_location = g_mount_get_root (mount); + link->details->icon = g_mount_get_icon (mount); + + nautilus_desktop_link_changed (link); +} + +static void trash_state_changed_callback (NautilusTrashMonitor *trash_monitor, gboolean state, gpointer callback_data) @@ -245,6 +263,9 @@ nautilus_desktop_link_new_from_mount (GMount *mount) link->details->activation_location = g_mount_get_root (mount); link->details->icon = g_mount_get_icon (mount); + g_signal_connect (mount, "changed", + G_CALLBACK (mount_changed_callback), link); + create_icon_file (link); return link; |