[gvfs/metadata: 6/12] Add placeholder implementation of metadata adding to gvfs
- From: Alexander Larsson <alexl src gnome org>
- To: svn-commits-list gnome org
- Subject: [gvfs/metadata: 6/12] Add placeholder implementation of metadata adding to gvfs
- Date: Thu, 18 Jun 2009 11:38:30 -0400 (EDT)
commit 77be542f6c5246f45586de0c3593955297f909fe
Author: Alexander Larsson <alexl redhat com>
Date: Thu Jun 18 09:10:33 2009 +0200
Add placeholder implementation of metadata adding to gvfs
client/gdaemonvfs.c | 42 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
---
diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c
index c9f2cc9..bbcda2c 100644
--- a/client/gdaemonvfs.c
+++ b/client/gdaemonvfs.c
@@ -1066,6 +1066,47 @@ g_daemon_vfs_parse_name (GVfs *vfs,
return file;
}
+static void
+g_daemon_vfs_add_extra_info_for_file (GVfs *vfs,
+ GFileInfo *info,
+ GFileAttributeMatcher *matcher,
+ const char *filename,
+ guint64 device,
+ guint64 parent_device_or_zero,
+ gpointer *extra_data)
+{
+ MetaLookupCache *cache;
+ const char *first;
+ gboolean all;
+
+ /* Filename may or may not be a symlink, but we should not follow it.
+ However, we want to follow symlinks for all parents that have the same
+ device node */
+ all = g_file_attribute_matcher_enumerate_namespace (matcher, "metadata");
+
+ first = NULL;
+ if (!all)
+ {
+ first = g_file_attribute_matcher_enumerate_next (matcher);
+
+ if (first == NULL)
+ return; /* No match */
+ }
+
+ if (*extra_data == NULL)
+ *extra_data = meta_lookup_cache_new ();
+ cache = (MetaLookupCache *)*extra_data;
+
+ g_file_info_set_attribute_string (info, "metadata::test", "Some value");
+}
+
+static void
+free_extra_data (GVfs *vfs,
+ gpointer extra_data)
+{
+ meta_lookup_cache_free (extra_data);
+}
+
DBusConnection *
_g_daemon_vfs_get_async_bus (void)
{
@@ -1103,6 +1144,7 @@ g_daemon_vfs_class_init (GDaemonVfsClass *class)
vfs_class->get_file_for_uri = g_daemon_vfs_get_file_for_uri;
vfs_class->get_supported_uri_schemes = g_daemon_vfs_get_supported_uri_schemes;
vfs_class->parse_name = g_daemon_vfs_parse_name;
+ vfs_class->add_extra_info_for_file = g_daemon_vfs_add_extra_info_for_file;
}
/* Module API */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]