summaryrefslogtreecommitdiff
path: root/common
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 /common
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 'common')
-rw-r--r--common/gmounttracker.c14
-rw-r--r--common/gmounttracker.h1
2 files changed, 13 insertions, 2 deletions
diff --git a/common/gmounttracker.c b/common/gmounttracker.c
index 28550681..2b5147a2 100644
--- a/common/gmounttracker.c
+++ b/common/gmounttracker.c
@@ -97,7 +97,8 @@ g_mount_info_dup (GMountInfo *info)
copy->user_visible = info->user_visible;
copy->prefered_filename_encoding = g_strdup (info->prefered_filename_encoding);
copy->fuse_mountpoint = g_strdup (info->fuse_mountpoint);
-
+ copy->default_location = g_strdup (info->default_location);
+
return copy;
}
@@ -122,6 +123,7 @@ g_mount_info_unref (GMountInfo *info)
g_mount_spec_unref (info->mount_spec);
g_free (info->prefered_filename_encoding);
g_free (info->fuse_mountpoint);
+ g_free (info->default_location);
g_free (info);
}
}
@@ -166,6 +168,7 @@ g_mount_info_from_dbus (DBusMessageIter *iter)
char *dbus_id;
char *obj_path;
char *fuse_mountpoint;
+ char *default_location;
GIcon *icon;
GError *error;
@@ -193,6 +196,12 @@ g_mount_info_from_dbus (DBusMessageIter *iter)
return NULL;
}
+ if (!_g_dbus_message_iter_get_args (&struct_iter, NULL,
+ G_DBUS_TYPE_CSTRING, &default_location,
+ 0))
+ default_location = g_strdup ("");
+
+
if (icon_str == NULL || strlen (icon_str) == 0)
icon_str = "drive-removable-media";
error = NULL;
@@ -216,7 +225,8 @@ g_mount_info_from_dbus (DBusMessageIter *iter)
info->user_visible = user_visible;
info->prefered_filename_encoding = g_strdup (prefered_filename_encoding);
info->fuse_mountpoint = fuse_mountpoint;
-
+ info->default_location = default_location;
+
return info;
}
diff --git a/common/gmounttracker.h b/common/gmounttracker.h
index efad24a9..4892baaf 100644
--- a/common/gmounttracker.h
+++ b/common/gmounttracker.h
@@ -50,6 +50,7 @@ typedef struct {
gboolean user_visible;
char *prefered_filename_encoding; /* NULL -> UTF8 */
char *fuse_mountpoint;
+ char *default_location;
GMountSpec *mount_spec;
} GMountInfo;