summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorChristian Kellner <gicmo@gnome.org>2009-10-09 17:07:46 +0200
committerAlexander Larsson <alexl@redhat.com>2009-11-26 16:28:26 +0100
commit6ad0cb9175acc635057232fec96d32eaad4e0237 (patch)
treead86e457ec7f60c2da98bf837a31b0b7e7a6ec9f /client
parentf2f50e72569406cfd974dcef6f293ebff3378f61 (diff)
downloadgvfs-6ad0cb9175acc635057232fec96d32eaad4e0237.tar.gz
Add "default location" support for mounts
The "default location" of the given mount is a path that reflects the main entry point for the user (e.g. the home directory, or the root of the volume). Backends can use g_vfs_backend_set_default_location () to set the default location (before registering the mount). https://bugzilla.gnome.org/show_bug.cgi?id=561998
Diffstat (limited to 'client')
-rw-r--r--client/gdaemonmount.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/client/gdaemonmount.c b/client/gdaemonmount.c
index 2f7e2d66..1f0e4c2e 100644
--- a/client/gdaemonmount.c
+++ b/client/gdaemonmount.c
@@ -130,6 +130,19 @@ g_daemon_mount_get_name (GMount *mount)
return g_strdup (daemon_mount->mount_info->display_name);
}
+static GFile *
+g_daemon_mount_get_default_location (GMount *mount)
+{
+ GDaemonMount *daemon_mount = G_DAEMON_MOUNT (mount);
+ const char *location = daemon_mount->mount_info->default_location;
+
+ if (location == NULL || location[0] == '\0')
+ location = daemon_mount->mount_info->mount_spec->mount_prefix;
+
+ return g_daemon_file_new (daemon_mount->mount_info->mount_spec,
+ location);
+}
+
static char *
g_daemon_mount_get_uuid (GMount *mount)
{
@@ -301,6 +314,7 @@ g_daemon_mount_mount_iface_init (GMountIface *iface)
iface->get_uuid = g_daemon_mount_get_uuid;
iface->get_volume = g_daemon_mount_get_volume;
iface->get_drive = g_daemon_mount_get_drive;
+ iface->get_default_location = g_daemon_mount_get_default_location;
iface->can_unmount = g_daemon_mount_can_unmount;
iface->can_eject = g_daemon_mount_can_eject;
iface->unmount = g_daemon_mount_unmount;