diff options
author | Paolo Borelli <pborelli@katamail.com> | 2008-03-25 11:32:18 +0000 |
---|---|---|
committer | Paolo Borelli <pborelli@src.gnome.org> | 2008-03-25 11:32:18 +0000 |
commit | 9a77824388efda2165a676eb1aac197a5ead56c0 (patch) | |
tree | 249b395c02635036444ddffe5b2bed2c6033e7b0 | |
parent | 34ebe8f3e8b4081c53d2facf9336ae4beed9d753 (diff) | |
download | gvfs-9a77824388efda2165a676eb1aac197a5ead56c0.tar.gz |
Make sure the display name is correct even for subdirectories inside the
2008-03-25 Paolo Borelli <pborelli@katamail.com>
* daemon/gvfsbackendtrash.c (add_extra_trash_info):
Make sure the display name is correct even for subdirectories
inside the trash. (#523127)
svn path=/trunk/; revision=1678
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | daemon/gvfsbackendtrash.c | 23 |
2 files changed, 13 insertions, 16 deletions
@@ -1,3 +1,9 @@ +2008-03-25 Paolo Borelli <pborelli@katamail.com> + + * daemon/gvfsbackendtrash.c (add_extra_trash_info): + Make sure the display name is correct even for subdirectories + inside the trash. (#523127) + 2008-03-25 Alexander Larsson <alexl@redhat.com> * daemon/gvfsbackendarchive.c (archive_file_set_info_from_entry): diff --git a/daemon/gvfsbackendtrash.c b/daemon/gvfsbackendtrash.c index c44dffe1..14dcbaa9 100644 --- a/daemon/gvfsbackendtrash.c +++ b/daemon/gvfsbackendtrash.c @@ -671,7 +671,6 @@ do_open_for_read (GVfsBackend *backend, } } - static void do_read (GVfsBackend *backend, GVfsJobRead *job, @@ -752,7 +751,6 @@ do_close_read (GVfsBackend *backend, g_vfs_job_failed_from_error (G_VFS_JOB (job), error); g_error_free (error); } - } typedef struct { @@ -951,9 +949,14 @@ add_extra_trash_info (GFileInfo *file_info, if (orig_path_unescaped) { - /* Set display name and edit name based of original basename */ - display_name = g_filename_display_basename (orig_path_unescaped); + if (g_path_is_absolute (orig_path_unescaped)) + orig_path = g_build_filename (orig_path_unescaped, relative_path, NULL); + else + orig_path = g_build_filename (topdir, orig_path_unescaped, relative_path, NULL); + g_free (orig_path_unescaped); + /* Set display name and edit name based of original basename */ + display_name = g_filename_display_basename (orig_path); g_file_info_set_edit_name (file_info, display_name); if (strstr (display_name, "\357\277\275") != NULL) @@ -975,22 +978,11 @@ add_extra_trash_info (GFileInfo *file_info, g_free (display_name); - - /* Set orig_path */ - - if (g_path_is_absolute (orig_path_unescaped)) - orig_path = g_build_filename (orig_path_unescaped, relative_path, NULL); - else - orig_path = g_build_filename (topdir, orig_path_unescaped, relative_path, NULL); - - g_file_info_set_attribute_byte_string (file_info, "trash::orig-path", orig_path); g_free (orig_path); - g_free (orig_path_unescaped); } - g_free (orig_path_key); } @@ -1048,7 +1040,6 @@ enumerate_root_trashdir (GVfsBackend *backend, name, NULL); - /* Update the name to also have the trash dir */ new_name = g_build_filename (trashdir, name, NULL); new_name_escaped = escape_pathname (new_name); |