diff options
author | Alexander Larsson <alexl@redhat.com> | 2009-03-23 10:55:40 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2009-03-23 10:55:40 +0000 |
commit | f205f6cfa56dbbc2dac6390bf4cd640ebfe6155c (patch) | |
tree | fed9c1b50b97c9563f82bd0c92a0344c640dee69 /daemon/trashlib | |
parent | 742ed7454a772ce71b80c168233751eb90756152 (diff) | |
download | gvfs-f205f6cfa56dbbc2dac6390bf4cd640ebfe6155c.tar.gz |
Bug 576337 – trash:/// show escaped filenames without decoding
2009-03-23 Alexander Larsson <alexl@redhat.com>
Bug 576337 – trash:/// show escaped filenames without decoding
* daemon/trashlib/trashitem.c:
(trash_item_get_trashinfo):
Unescape Path key correctly.
svn path=/trunk/; revision=2346
Diffstat (limited to 'daemon/trashlib')
-rw-r--r-- | daemon/trashlib/trashitem.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/daemon/trashlib/trashitem.c b/daemon/trashlib/trashitem.c index 7ad79735..335e8d4f 100644 --- a/daemon/trashlib/trashitem.c +++ b/daemon/trashlib/trashitem.c @@ -162,26 +162,31 @@ trash_item_get_trashinfo (GFile *path, if (g_key_file_load_from_file (keyfile, trashinfo, 0, NULL)) { - char *orig; + char *orig, *decoded; + decoded = NULL; orig = g_key_file_get_string (keyfile, "Trash Info", "Path", NULL); if (orig == NULL) *original = NULL; - - else if (g_path_is_absolute (orig)) - *original = g_file_new_for_path (orig); - else - { - GFile *rootdir; - - rootdir = g_file_get_parent (trashdir); - *original = g_file_get_child (rootdir, orig); - g_object_unref (rootdir); - } + { + decoded = g_uri_unescape_string (orig, NULL); + + if (g_path_is_absolute (decoded)) + *original = g_file_new_for_path (decoded); + else + { + GFile *rootdir; + + rootdir = g_file_get_parent (trashdir); + *original = g_file_get_child (rootdir, decoded); + g_object_unref (rootdir); + } + g_free (decoded); + } g_free (orig); |