diff options
author | David Zeuthen <davidz@redhat.com> | 2007-12-19 10:06:28 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2007-12-19 10:06:28 +0000 |
commit | c1be928d8e01972379156950397f813994c81b62 (patch) | |
tree | 499b164fb1bf24d93ce7072e0250428e67813e9f /daemon/mount.c | |
parent | cb5c86a46ce371035ab4c5078fa69be389ed7f06 (diff) | |
download | gvfs-c1be928d8e01972379156950397f813994c81b62.tar.gz |
Add the cdda:// backend for Compact Disc Digital Audio discs.
2007-12-19 David Zeuthen <davidz@redhat.com>
Add the cdda:// backend for Compact Disc Digital Audio discs.
Allow a backend to specify the fuse name directly instead of
using the display name
Make GDaemonVolumeMonitor and GDaemonMount use the new
adopt_orphan_mount() function on GVolumeMonitor in gio. Also,
since a GMount now can be associated with a GVolume, implement
eject().
Add a new gvfs-less program.
Make gvfs-mount capable of unmounting as well.
HAL backend changes: attempt to unmount all mounts from
enclosing volumes and fail the ejection if one of the unmount
operations fails. Use new adopt_orphan_mount() from gio to
adopt cdda:// volumes for audio discs. Emit the 'eject-button'
signal on GDrive. Various other fixes.
* client/gdaemonfile.c: (g_daemon_file_find_enclosing_mount):
* client/gdaemonmount.c: (g_daemon_mount_finalize),
(g_daemon_mount_new), (g_daemon_mount_get_volume),
(g_daemon_mount_get_drive), (g_daemon_mount_can_eject),
(foreign_volume_removed), (g_daemon_mount_set_foreign_volume),
(eject_wrapper_callback), (g_daemon_mount_eject),
(g_daemon_mount_eject_finish), (g_daemon_mount_mount_iface_init):
* client/gdaemonmount.h:
* client/gdaemonvolumemonitor.c: (mount_added), (mount_removed),
(g_daemon_volume_monitor_init):
* client/gvfsfusedaemon.c: (file_handle_close_stream),
(free_file_handle_for_path), (mount_record_new):
* common/gmounttracker.c: (g_mount_info_dup), (g_mount_info_unref),
(g_mount_info_from_dbus):
* common/gmounttracker.h:
* configure.ac:
* daemon/Makefile.am:
* daemon/gvfsbackend.c: (g_vfs_backend_finalize),
(g_vfs_backend_init), (g_vfs_backend_set_fuse_name),
(g_vfs_backend_get_fuse_name), (g_vfs_backend_register_mount):
* daemon/gvfsbackend.h:
* daemon/gvfsjobunmount.c: (unregister_mount_callback),
(send_reply):
* daemon/mount.c: (vfs_mount_free), (vfs_mount_to_dbus),
(register_mount), (list_mounts):
* hal/ghaldrive.c: (g_hal_drive_finalize), (hal_condition),
(g_hal_drive_new), (spawn_cb), (g_hal_drive_eject_do),
(free_unmount_mounts_op), (_eject_unmount_mounts_cb),
(_eject_unmount_mounts), (g_hal_drive_eject):
* hal/ghalmount.c: (g_hal_mount_finalize), (unmount_cb),
(unmount_read_error), (unmount_do), (g_hal_mount_unmount),
(eject_wrapper_callback), (g_hal_mount_eject),
(g_hal_mount_eject_finish):
* hal/ghalvolume.c: (g_hal_volume_finalize), (do_update_from_hal),
(g_hal_volume_new), (g_hal_volume_get_mount),
(foreign_mount_unmounted), (g_hal_volume_adopt_foreign_mount),
(g_hal_volume_has_foreign_mount_root), (spawn_cb),
(mount_foreign_callback), (g_hal_volume_mount),
(g_hal_volume_mount_finish), (eject_wrapper_callback),
(g_hal_volume_eject), (g_hal_volume_eject_finish):
* hal/ghalvolume.h:
* hal/ghalvolumemonitor.c: (adopt_orphan_mount),
(g_hal_volume_monitor_class_init), (update_volumes),
(update_mounts), (update_discs):
* hal/hal-device.c: (hal_device_class_init),
(_hal_device_hal_condition):
* hal/hal-device.h:
* hal/hal-marshal.list:
* hal/hal-pool.c: (hal_pool_class_init), (_hal_condition),
(hal_pool_new):
* hal/hal-pool.h:
* programs/Makefile.am:
* programs/gvfs-mount.c: (unmount_done_cb), (unmount), (main):
svn path=/trunk/; revision=1052
Diffstat (limited to 'daemon/mount.c')
-rw-r--r-- | daemon/mount.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/daemon/mount.c b/daemon/mount.c index 12d3ff81..cfda6779 100644 --- a/daemon/mount.c +++ b/daemon/mount.c @@ -36,6 +36,7 @@ typedef struct { char *display_name; + char *stable_name; char *icon; char *prefered_filename_encoding; gboolean user_visible; @@ -138,6 +139,7 @@ static void vfs_mount_free (VfsMount *mount) { g_free (mount->display_name); + g_free (mount->stable_name); g_free (mount->icon); g_free (mount->prefered_filename_encoding); g_free (mount->dbus_id); @@ -175,6 +177,11 @@ vfs_mount_to_dbus (VfsMount *mount, DBUS_TYPE_STRING, &mount->display_name)) _g_dbus_oom (); + + if (!dbus_message_iter_append_basic (&struct_iter, + DBUS_TYPE_STRING, + &mount->stable_name)) + _g_dbus_oom (); if (!dbus_message_iter_append_basic (&struct_iter, DBUS_TYPE_STRING, @@ -199,14 +206,14 @@ vfs_mount_to_dbus (VfsMount *mount, char *fs_name; /* Keep in sync with fuse daemon */ - fs_name = g_uri_escape_string (mount->display_name, "+@#$., ", TRUE); + fs_name = g_uri_escape_string (mount->stable_name, "+@#$., ", TRUE); fuse_mountpoint = g_build_filename (g_get_home_dir(), ".gvfs", fs_name, NULL); } if (fuse_mountpoint == NULL) fuse_mountpoint = g_strdup (""); - + _g_dbus_message_iter_append_cstring (&struct_iter, fuse_mountpoint); g_mount_spec_to_dbus (&struct_iter, mount->mount_spec); @@ -551,7 +558,7 @@ register_mount (DBusConnection *connection, VfsMount *mount; DBusMessage *reply; DBusError error; - const char *display_name, *icon, *obj_path, *id, *prefered_filename_encoding; + const char *display_name, *stable_name, *icon, *obj_path, *id, *prefered_filename_encoding; dbus_bool_t user_visible; DBusMessageIter iter; GMountSpec *mount_spec; @@ -565,6 +572,7 @@ register_mount (DBusConnection *connection, &error, DBUS_TYPE_OBJECT_PATH, &obj_path, DBUS_TYPE_STRING, &display_name, + DBUS_TYPE_STRING, &stable_name, DBUS_TYPE_STRING, &icon, DBUS_TYPE_STRING, &prefered_filename_encoding, DBUS_TYPE_BOOLEAN, &user_visible, @@ -577,7 +585,7 @@ register_mount (DBusConnection *connection, else if ((mount_spec = g_mount_spec_from_dbus (&iter)) == NULL) reply = dbus_message_new_error (message, DBUS_ERROR_INVALID_ARGS, - "Error in mount spec"); + "Error in mount spec"); else if (match_vfs_mount (mount_spec) != NULL) reply = dbus_message_new_error (message, DBUS_ERROR_INVALID_ARGS, @@ -586,6 +594,7 @@ register_mount (DBusConnection *connection, { mount = g_new0 (VfsMount, 1); mount->display_name = g_strdup (display_name); + mount->stable_name = g_strdup (stable_name); mount->icon = g_strdup (icon); mount->prefered_filename_encoding = g_strdup (prefered_filename_encoding); mount->user_visible = user_visible; @@ -751,6 +760,7 @@ list_mounts (DBusConnection *connection, DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_STRING_AS_STRING + DBUS_TYPE_STRING_AS_STRING DBUS_TYPE_BOOLEAN_AS_STRING DBUS_TYPE_ARRAY_AS_STRING DBUS_TYPE_BYTE_AS_STRING G_MOUNT_SPEC_TYPE_AS_STRING |