diff options
| author | Tomas Bzatek <tbzatek@tbzatek.englab.brq.redhat.com> | 2008-08-28 11:33:54 +0200 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@tbzatek.englab.brq.redhat.com> | 2008-08-28 11:33:54 +0200 |
| commit | 0001a00f0bbc93136ea42a761bc88368bdfc3dc4 (patch) | |
| tree | a55375841e594a85f170dbd7830049f23669789b | |
| parent | fc7cc5893d166a2be42ebcb6f6cef6b72c5470f3 (diff) | |
| download | tuxcmd-modules-0001a00f0bbc93136ea42a761bc88368bdfc3dc4.tar.xz | |
GVFS plugin: fix remote path handling
| -rw-r--r-- | gvfs/gvfs.c | 25 |
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; } |
