diff options
author | Sebastian Dröge <sdroege@src.gnome.org> | 2007-10-08 05:59:15 +0000 |
---|---|---|
committer | Sebastian Dröge <sdroege@src.gnome.org> | 2007-10-08 05:59:15 +0000 |
commit | 52e63ca2a3371cbaf24d8189ec80abd24dc0fd99 (patch) | |
tree | 2f8f7a2b877fcd2aeceefde37baf3322ad7ea4cb /common | |
parent | cdc36a1c7d65f84cccbc24c2078b999ea7f060b6 (diff) | |
download | gvfs-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 'common')
-rw-r--r-- | common/gvfsdaemonprotocol.h | 1 | ||||
-rw-r--r-- | common/gvfsurimapper.c | 16 | ||||
-rw-r--r-- | common/gvfsurimapper.h | 46 |
3 files changed, 40 insertions, 23 deletions
diff --git a/common/gvfsdaemonprotocol.h b/common/gvfsdaemonprotocol.h index 2554ab77..d5caf50e 100644 --- a/common/gvfsdaemonprotocol.h +++ b/common/gvfsdaemonprotocol.h @@ -15,6 +15,7 @@ G_BEGIN_DECLS #define G_VFS_DBUS_MOUNTTRACKER_OP_MOUNT_LOCATION "mountLocation" #define G_VFS_DBUS_MOUNTTRACKER_OP_LIST_MOUNTS "listMounts" #define G_VFS_DBUS_MOUNTTRACKER_OP_REGISTER_MOUNT "registerMount" +#define G_VFS_DBUS_MOUNTTRACKER_OP_LIST_MOUNT_TYPES "listMountTypes" #define G_VFS_DBUS_MOUNTTRACKER_SIGNAL_MOUNTED "mounted" #define G_VFS_DBUS_MOUNTTRACKER_SIGNAL_UNMOUNTED "unmounted" diff --git a/common/gvfsurimapper.c b/common/gvfsurimapper.c index 763470d4..e60c24ae 100644 --- a/common/gvfsurimapper.c +++ b/common/gvfsurimapper.c @@ -15,7 +15,7 @@ g_vfs_uri_mapper_init (GVfsUriMapper *vfs) { } -const char ** +const char * const * g_vfs_uri_mapper_get_handled_schemes (GVfsUriMapper *mapper) { GVfsUriMapperClass *class; @@ -39,7 +39,7 @@ g_vfs_uri_mapper_from_uri (GVfsUriMapper *mapper, return (* class->from_uri) (mapper, uri, spec_out, path_out); } -const char ** +const char * const * g_vfs_uri_mapper_get_handled_mount_types (GVfsUriMapper *mapper) { GVfsUriMapperClass *class; @@ -61,3 +61,15 @@ g_vfs_uri_mapper_to_uri (GVfsUriMapper *mapper, return (* class->to_uri) (mapper, spec, path, allow_utf8); } + +char * +g_vfs_uri_mapper_to_uri_scheme (GVfsUriMapper *mapper, + GMountSpec *spec) +{ + GVfsUriMapperClass *class; + + class = G_VFS_URI_MAPPER_GET_CLASS (mapper); + + return (* class->to_uri_scheme) (mapper, spec); +} + diff --git a/common/gvfsurimapper.h b/common/gvfsurimapper.h index a0d3b404..94c8c6f7 100644 --- a/common/gvfsurimapper.h +++ b/common/gvfsurimapper.h @@ -27,32 +27,36 @@ struct _GVfsUriMapperClass /* Virtual Table */ - const char ** (*get_handled_schemes) (GVfsUriMapper *mapper); - gboolean (*from_uri) (GVfsUriMapper *mapper, - const char *uri, - GMountSpec **spec_out, - char **path_out); + const char * const * (*get_handled_schemes) (GVfsUriMapper *mapper); + gboolean (*from_uri) (GVfsUriMapper *mapper, + const char *uri, + GMountSpec **spec_out, + char **path_out); - const char ** (*get_handled_mount_types) (GVfsUriMapper *mapper); - char * (*to_uri) (GVfsUriMapper *mapper, - GMountSpec *spec, - char *path, - gboolean allow_utf8); + const char * const * (*get_handled_mount_types) (GVfsUriMapper *mapper); + char * (*to_uri) (GVfsUriMapper *mapper, + GMountSpec *spec, + char *path, + gboolean allow_utf8); + char * (*to_uri_scheme) (GVfsUriMapper *mapper, + GMountSpec *spec); }; GType g_vfs_uri_mapper_get_type (void) G_GNUC_CONST; -const char **g_vfs_uri_mapper_get_handled_schemes (GVfsUriMapper *mapper); -gboolean g_vfs_uri_mapper_from_uri (GVfsUriMapper *mapper, - const char *uri, - GMountSpec **spec_out, - char **path_out); - -const char **g_vfs_uri_mapper_get_handled_mount_types (GVfsUriMapper *mapper); -char * g_vfs_uri_mapper_to_uri (GVfsUriMapper *mapper, - GMountSpec *spec, - char *path, - gboolean allow_utf8); +const char * const * g_vfs_uri_mapper_get_handled_schemes (GVfsUriMapper *mapper); +gboolean g_vfs_uri_mapper_from_uri (GVfsUriMapper *mapper, + const char *uri, + GMountSpec **spec_out, + char **path_out); + +const char * const * g_vfs_uri_mapper_get_handled_mount_types (GVfsUriMapper *mapper); +char * g_vfs_uri_mapper_to_uri (GVfsUriMapper *mapper, + GMountSpec *spec, + char *path, + gboolean allow_utf8); +char * g_vfs_uri_mapper_to_uri_scheme (GVfsUriMapper *mapper, + GMountSpec *spec); G_END_DECLS |