summaryrefslogtreecommitdiff
path: root/gvfs/gvfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'gvfs/gvfs.c')
-rw-r--r--gvfs/gvfs.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/gvfs/gvfs.c b/gvfs/gvfs.c
index c71faff..31b9fb2 100644
--- a/gvfs/gvfs.c
+++ b/gvfs/gvfs.c
@@ -32,8 +32,8 @@
-#define VERSION "0.0.2"
-#define BUILD_DATE "2008-08-25"
+#define VERSION "0.0.3"
+#define BUILD_DATE "2008-08-28"
#define DEFAULT_BLOCK_SIZE 0x10000 /* 64kB */
#define CONST_DEFAULT_QUERY_INFO_ATTRIBUTES G_FILE_ATTRIBUTE_STANDARD_TYPE "," G_FILE_ATTRIBUTE_STANDARD_NAME "," \
@@ -336,8 +336,25 @@ VFSClose (struct TVFSGlobs *globs)
char *
VFSGetPath (struct TVFSGlobs *globs)
{
- if (globs->file)
- return g_file_get_path (globs->file);
+ GFile *root;
+ char *path, *s;
+
+ if (globs->file) {
+ root = g_file_resolve_relative_path (globs->file, "/");
+ if (root == NULL)
+ return NULL;
+ path = g_file_get_relative_path (root, globs->file);
+ if (path == NULL)
+ return NULL;
+ if (! g_path_is_absolute (path))
+ s = g_strdup_printf ("/%s", path);
+ else
+ s = g_strdup (path);
+ g_print ("(II) VFSGetPath: '%s'\n", s);
+ g_free (path);
+ g_object_unref (root);
+ return s;
+ }
else
return NULL;
}