summaryrefslogtreecommitdiff
path: root/daemon
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2007-10-31 15:31:06 +0000
committerAlexander Larsson <alexl@src.gnome.org>2007-10-31 15:31:06 +0000
commitd6ce9fc4cf74aa567a9b83074a44f9aba0398f56 (patch)
tree0a36e0cceaab800ba17bc08e0ce231f15207b154 /daemon
parent6c40b17432a40219c591364945ece14fc98c204d (diff)
downloadgvfs-d6ce9fc4cf74aa567a9b83074a44f9aba0398f56.tar.gz
Add g_vfs_backend_get_mount_spec
2007-10-31 Alexander Larsson <alexl@redhat.com> * daemon/gvfsbackend.[ch]: Add g_vfs_backend_get_mount_spec * daemon/gvfsjobqueryfsinfo.c: Fix indentation * daemon/gvfsjobqueryinfo.c: Implement id:fs attribute svn path=/trunk/; revision=1004
Diffstat (limited to 'daemon')
-rw-r--r--daemon/gvfsbackend.c8
-rw-r--r--daemon/gvfsbackend.h1
-rw-r--r--daemon/gvfsjobqueryfsinfo.c12
-rw-r--r--daemon/gvfsjobqueryinfo.c30
4 files changed, 38 insertions, 13 deletions
diff --git a/daemon/gvfsbackend.c b/daemon/gvfsbackend.c
index 61682d4c..6999d960 100644
--- a/daemon/gvfsbackend.c
+++ b/daemon/gvfsbackend.c
@@ -301,6 +301,14 @@ g_vfs_backend_get_icon_name (GVfsBackend *backend)
return backend->priv->icon;
}
+GMountSpec *
+g_vfs_backend_get_mount_spec (GVfsBackend *backend)
+{
+ return backend->priv->mount_spec;
+}
+
+
+
static DBusHandlerResult
backend_dbus_handler (DBusConnection *connection,
DBusMessage *message,
diff --git a/daemon/gvfsbackend.h b/daemon/gvfsbackend.h
index f5b88bf5..22673eca 100644
--- a/daemon/gvfsbackend.h
+++ b/daemon/gvfsbackend.h
@@ -332,6 +332,7 @@ void g_vfs_backend_register_mount (GVfsBackend *ba
const char *g_vfs_backend_get_backend_type (GVfsBackend *backend);
const char *g_vfs_backend_get_display_name (GVfsBackend *backend);
const char *g_vfs_backend_get_icon_name (GVfsBackend *backend);
+GMountSpec *g_vfs_backend_get_mount_spec (GVfsBackend *backend);
GVfsDaemon *g_vfs_backend_get_daemon (GVfsBackend *backend);
G_END_DECLS
diff --git a/daemon/gvfsjobqueryfsinfo.c b/daemon/gvfsjobqueryfsinfo.c
index 13866b8b..508be56e 100644
--- a/daemon/gvfsjobqueryfsinfo.c
+++ b/daemon/gvfsjobqueryfsinfo.c
@@ -56,8 +56,8 @@ g_vfs_job_query_fs_info_init (GVfsJobQueryFsInfo *job)
GVfsJob *
g_vfs_job_query_fs_info_new (DBusConnection *connection,
- DBusMessage *message,
- GVfsBackend *backend)
+ DBusMessage *message,
+ GVfsBackend *backend)
{
GVfsJobQueryFsInfo *job;
DBusMessage *reply;
@@ -111,10 +111,10 @@ run (GVfsJob *job)
}
class->query_fs_info (op_job->backend,
- op_job,
- op_job->filename,
- op_job->file_info,
- op_job->attribute_matcher);
+ op_job,
+ op_job->filename,
+ op_job->file_info,
+ op_job->attribute_matcher);
}
static gboolean
diff --git a/daemon/gvfsjobqueryinfo.c b/daemon/gvfsjobqueryinfo.c
index 47dfd412..8f7a10b7 100644
--- a/daemon/gvfsjobqueryinfo.c
+++ b/daemon/gvfsjobqueryinfo.c
@@ -58,8 +58,8 @@ g_vfs_job_query_info_init (GVfsJobQueryInfo *job)
GVfsJob *
g_vfs_job_query_info_new (DBusConnection *connection,
- DBusMessage *message,
- GVfsBackend *backend)
+ DBusMessage *message,
+ GVfsBackend *backend)
{
GVfsJobQueryInfo *job;
DBusMessage *reply;
@@ -134,11 +134,11 @@ try (GVfsJob *job)
return FALSE;
return class->try_query_info (op_job->backend,
- op_job,
- op_job->filename,
- op_job->flags,
- op_job->file_info,
- op_job->attribute_matcher);
+ op_job,
+ op_job->filename,
+ op_job->flags,
+ op_job->file_info,
+ op_job->attribute_matcher);
}
/* Might be called on an i/o thread */
@@ -150,11 +150,27 @@ create_reply (GVfsJob *job,
GVfsJobQueryInfo *op_job = G_VFS_JOB_QUERY_INFO (job);
DBusMessage *reply;
DBusMessageIter iter;
+ GMountSpec *spec;
+ char *id;
reply = dbus_message_new_method_return (message);
dbus_message_iter_init_append (reply, &iter);
+ if (g_file_attribute_matcher_matches (op_job->attribute_matcher,
+ G_FILE_ATTRIBUTE_ID_FS))
+ {
+ spec = g_vfs_backend_get_mount_spec (op_job->backend);
+ if (spec)
+ {
+ id = g_mount_spec_to_string (spec);
+ g_file_info_set_attribute_string (op_job->file_info,
+ G_FILE_ATTRIBUTE_ID_FS,
+ id);
+ g_free (id);
+ }
+ }
+
_g_dbus_append_file_info (&iter,
op_job->file_info);