summaryrefslogtreecommitdiff
path: root/client/smburi.c
diff options
context:
space:
mode:
authorSebastian Dröge <sdroege@src.gnome.org>2007-10-08 05:59:15 +0000
committerSebastian Dröge <sdroege@src.gnome.org>2007-10-08 05:59:15 +0000
commit52e63ca2a3371cbaf24d8189ec80abd24dc0fd99 (patch)
tree2f8f7a2b877fcd2aeceefde37baf3322ad7ea4cb /client/smburi.c
parentcdc36a1c7d65f84cccbc24c2078b999ea7f060b6 (diff)
downloadgvfs-52e63ca2a3371cbaf24d8189ec80abd24dc0fd99.tar.gz
Implement get_supported_uri_schemes method and add a GVfsUriMapper method
* client/gdaemonvfs.c: (g_daemon_vfs_finalize), (g_daemon_vfs_init), (fill_supported_uri_schemes), (g_daemon_vfs_get_supported_uri_schemes), (g_daemon_vfs_class_init): * client/smburi.c: (smb_to_uri_scheme), (g_vfs_uri_mapper_smb_class_init): * common/gvfsdaemonprotocol.h: * common/gvfsurimapper.c: (g_vfs_uri_mapper_to_uri_scheme): * common/gvfsurimapper.h: * daemon/mount.c: (list_mount_types), (dbus_message_function): Implement get_supported_uri_schemes method and add a GVfsUriMapper method to map a mount spec to an URI scheme. svn path=/trunk/; revision=970
Diffstat (limited to 'client/smburi.c')
-rw-r--r--client/smburi.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/client/smburi.c b/client/smburi.c
index b8633f35..36afcc37 100644
--- a/client/smburi.c
+++ b/client/smburi.c
@@ -80,7 +80,7 @@ normalize_smb_name (const char *name, gssize len)
return g_ascii_strdown (name, len);
}
-static const char **
+static const char * const *
smb_get_handled_schemes (GVfsUriMapper *mapper)
{
static const char *schemes[] = {
@@ -206,7 +206,7 @@ smb_from_uri (GVfsUriMapper *mapper,
return spec != NULL;
}
-static const char **
+static const char * const *
smb_get_handled_mount_types (GVfsUriMapper *mapper)
{
static const char *types[] = {
@@ -267,6 +267,18 @@ smb_to_uri (GVfsUriMapper *mapper,
return s;
}
+static gchar *
+smb_to_uri_scheme (GVfsUriMapper *mapper,
+ GMountSpec *spec)
+{
+ const gchar *type = g_mount_spec_get_type (spec);
+ if (strcmp ("smb-network", type) == 0 ||
+ strcmp ("smb-server", type) == 0 ||
+ strcmp ("smb-share", type) == 0)
+ return g_strdup ("smb");
+ else
+ return NULL;
+}
static void
g_vfs_uri_mapper_smb_class_init (GVfsUriMapperSmbClass *class)
@@ -281,4 +293,5 @@ g_vfs_uri_mapper_smb_class_init (GVfsUriMapperSmbClass *class)
mapper_class->from_uri = smb_from_uri;
mapper_class->get_handled_mount_types = smb_get_handled_mount_types;
mapper_class->to_uri = smb_to_uri;
+ mapper_class->to_uri_scheme = smb_to_uri_scheme;
}