summaryrefslogtreecommitdiff
path: root/daemon/gvfsbackendtrash.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2008-01-10 14:04:49 +0000
committerAlexander Larsson <alexl@src.gnome.org>2008-01-10 14:04:49 +0000
commit289e4ac8ee5c3e3c9bd8c1bbf1c0d8ff9b72c836 (patch)
treedf331cab7d8c7dfe0aeb4d8b9017aef12cd863a6 /daemon/gvfsbackendtrash.c
parentfd7a19aeea4f0c9482a06d83eedf88a5f706861f (diff)
downloadgvfs-289e4ac8ee5c3e3c9bd8c1bbf1c0d8ff9b72c836.tar.gz
Remove freeing of initial ref after delay.
2008-01-10 Alexander Larsson <alexl@redhat.com> * daemon/gvfsmonitor.c: Remove freeing of initial ref after delay. * daemon/gvfsjobcreatemonitor.[ch]: Set the monitor as result here, not only the obj path. Nicer and allows better lifetime handling. If returning a obj ref, keep the monitor alive for some time to allow a subscribe request. * daemon/gvfsbackendcomputer.c: * daemon/gvfsbackendtrash.c: Update to the new APIs svn path=/trunk/; revision=1090
Diffstat (limited to 'daemon/gvfsbackendtrash.c')
-rw-r--r--daemon/gvfsbackendtrash.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/daemon/gvfsbackendtrash.c b/daemon/gvfsbackendtrash.c
index 3cf1d0b8..355a3558 100644
--- a/daemon/gvfsbackendtrash.c
+++ b/daemon/gvfsbackendtrash.c
@@ -1532,7 +1532,7 @@ do_create_root_monitor (GVfsBackend *backend)
created = TRUE;
}
- vfs_monitor = g_object_ref (trash_backend->vfs_monitor);
+ vfs_monitor = trash_backend->vfs_monitor;
G_UNLOCK (root_monitor);
if (created)
@@ -1565,8 +1565,8 @@ do_create_dir_monitor (GVfsBackend *backend,
/* The trash:/// root */
vfs_monitor = do_create_root_monitor (backend);
- g_vfs_job_create_monitor_set_obj_path (job,
- g_vfs_monitor_get_object_path (vfs_monitor));
+ g_vfs_job_create_monitor_set_monitor (job,
+ vfs_monitor);
g_vfs_job_succeeded (G_VFS_JOB (job));
g_object_unref (vfs_monitor);
@@ -1595,11 +1595,13 @@ do_create_dir_monitor (GVfsBackend *backend,
proxy->base_file = g_object_ref (file);
proxy->mount_spec = g_mount_spec_ref (G_VFS_BACKEND_TRASH (backend)->mount_spec);
- g_object_set_data_full (G_OBJECT (proxy->vfs_monitor), "monitor-proxy", proxy, (GDestroyNotify) monitor_proxy_free);
+ g_object_set_data_full (G_OBJECT (proxy->vfs_monitor), "monitor-proxy", proxy,
+ (GDestroyNotify) monitor_proxy_free);
g_signal_connect (monitor, "changed", G_CALLBACK (proxy_changed), proxy);
- g_vfs_job_create_monitor_set_obj_path (job,
- g_vfs_monitor_get_object_path (proxy->vfs_monitor));
+ g_vfs_job_create_monitor_set_monitor (job,
+ proxy->vfs_monitor);
+ g_object_unref (proxy->vfs_monitor);
g_vfs_job_succeeded (G_VFS_JOB (job));
}
@@ -1637,12 +1639,11 @@ do_create_file_monitor (GVfsBackend *backend,
if (trash_backend->file_vfs_monitor == NULL)
trash_backend->file_vfs_monitor = g_vfs_monitor_new (g_vfs_backend_get_daemon (backend));
- vfs_monitor = g_object_ref (trash_backend->file_vfs_monitor);
+ vfs_monitor = trash_backend->file_vfs_monitor;
g_object_add_weak_pointer (G_OBJECT (vfs_monitor), (gpointer *)&trash_backend->file_vfs_monitor);
G_UNLOCK (root_monitor);
- g_vfs_job_create_monitor_set_obj_path (job,
- g_vfs_monitor_get_object_path (vfs_monitor));
+ g_vfs_job_create_monitor_set_monitor (job, vfs_monitor);
g_vfs_job_succeeded (G_VFS_JOB (job));
g_object_unref (vfs_monitor);
}
@@ -1673,8 +1674,9 @@ do_create_file_monitor (GVfsBackend *backend,
g_object_set_data_full (G_OBJECT (proxy->vfs_monitor), "monitor-proxy", proxy, (GDestroyNotify) monitor_proxy_free);
g_signal_connect (monitor, "changed", G_CALLBACK (proxy_changed), proxy);
- g_vfs_job_create_monitor_set_obj_path (job,
- g_vfs_monitor_get_object_path (proxy->vfs_monitor));
+ g_vfs_job_create_monitor_set_monitor (job,
+ proxy->vfs_monitor);
+ g_object_unref (proxy->vfs_monitor);
g_vfs_job_succeeded (G_VFS_JOB (job));
}