[gvfs] gphoto2: Use new default auto-busy code
- From: Christian Kellner <gicmo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] gphoto2: Use new default auto-busy code
- Date: Tue, 7 Jun 2011 12:56:03 +0000 (UTC)
commit 9f4d55f0c91bfc72ae525540e22320d0679d05b9
Author: Christian Kellner <gicmo gnome org>
Date: Tue Jun 7 14:50:18 2011 +0200
gphoto2: Use new default auto-busy code
Get rid of the custom unmount code und fallback to default
implementation which does the exact same thing.
daemon/gvfsbackendgphoto2.c | 78 +------------------------------------------
1 files changed, 1 insertions(+), 77 deletions(-)
---
diff --git a/daemon/gvfsbackendgphoto2.c b/daemon/gvfsbackendgphoto2.c
index 1f18788..00979a1 100644
--- a/daemon/gvfsbackendgphoto2.c
+++ b/daemon/gvfsbackendgphoto2.c
@@ -1779,81 +1779,6 @@ try_mount (GVfsBackend *backend,
/* ------------------------------------------------------------------------------------------------- */
static void
-unmount_with_op_cb (GVfsBackend *backend,
- GAsyncResult *res,
- gpointer user_data)
-{
- GVfsJobUnmount *job = G_VFS_JOB_UNMOUNT (user_data);
- gboolean should_unmount;
-
- DEBUG ("In unmount_with_op_cb");
-
- should_unmount = g_vfs_backend_unmount_with_operation_finish (backend,
- res);
-
- DEBUG ("should_unmount=%d", should_unmount);
-
- if (should_unmount)
- {
-
- DEBUG ("unmounted %p", backend);
- g_vfs_job_succeeded (G_VFS_JOB (job));
- }
- else
- {
- GError *error;
- error = g_error_new (G_IO_ERROR,
- G_IO_ERROR_FAILED_HANDLED,
- _("Filesystem is busy"));
- g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
- g_error_free (error);
- }
-}
-
-static gboolean
-try_unmount (GVfsBackend *backend,
- GVfsJobUnmount *job,
- GMountUnmountFlags flags,
- GMountSource *mount_source)
-{
- DEBUG ("In try_unmount, unmount_flags=%d", flags, mount_source);
-
- if (flags & G_MOUNT_UNMOUNT_FORCE)
- {
- DEBUG ("forcibly unmounted %p", backend);
- g_vfs_job_succeeded (G_VFS_JOB (job));
- }
- else if (g_mount_source_is_dummy (mount_source))
- {
- if (g_vfs_backend_has_blocking_processes (backend))
- {
- GError *error;
- error = g_error_new (G_IO_ERROR,
- G_IO_ERROR_BUSY,
- _("Filesystem is busy"));
- g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
- g_error_free (error);
- }
- else
- {
- DEBUG ("unmounted %p", backend);
- g_vfs_job_succeeded (G_VFS_JOB (job));
- }
- }
- else
- {
- g_vfs_backend_unmount_with_operation (backend,
- mount_source,
- (GAsyncReadyCallback) unmount_with_op_cb,
- job);
- }
-
- return TRUE;
-}
-
-/* ------------------------------------------------------------------------------------------------- */
-
-static void
free_read_handle (ReadHandle *read_handle)
{
if (read_handle->file != NULL)
@@ -3597,8 +3522,7 @@ g_vfs_backend_gphoto2_class_init (GVfsBackendGphoto2Class *klass)
backend_class->try_mount = try_mount;
backend_class->mount = do_mount;
- backend_class->try_unmount = try_unmount;
- backend_class->open_icon_for_read = do_open_icon_for_read;
+ backend_class->open_icon_for_read = do_open_icon_for_read;
backend_class->open_for_read = do_open_for_read;
backend_class->try_read = try_read;
backend_class->try_seek_on_read = try_seek_on_read;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]