[PATCH] gnome_vfs_find_directory should use the parent uri when possible

View: New views
2 Messages — Rating Filter:   Alert me  

[PATCH] gnome_vfs_find_directory should use the parent uri when possible

by Yann Rouillard :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The attached patch changes the gnome_vfs_find_directory_cancellable function so the parent_uri is used to find the special directory instead of the given uri.
It is needed to properly find the trash for a symlink whose target is on another filesystem.

Otherwise, as the uri is resolved, the trash for the filesystem of the symlink target is returned instead of the trash for the filesystem of the symlink itself.

This patch solves the bugzilla issue: http://bugzilla.gnome.org/show_bug.cgi?id=312506
and tries to follow Alexander Larsson advice: http://mail.gnome.org/archives/nautilus-list/2005-October/msg00159.html


Yann



[34_delete_symlink_across_filesystem.patch]

diff -Nur gnome-vfs2-2.20.0/libgnomevfs/gnome-vfs-cancellable-ops.c gnome-vfs2-2.20.0.new/libgnomevfs/gnome-vfs-cancellable-ops.c
--- gnome-vfs2-2.20.0/libgnomevfs/gnome-vfs-cancellable-ops.c 2007-09-17 19:00:46.000000000 +0200
+++ gnome-vfs2-2.20.0.new/libgnomevfs/gnome-vfs-cancellable-ops.c 2007-10-21 20:50:23.000000000 +0200
@@ -285,7 +285,7 @@
       GnomeVFSContext *context)
 {
  GnomeVFSResult result;
- GnomeVFSURI *resolved_uri;
+ GnomeVFSURI *resolved_uri, *parent_uri;
 
  g_return_val_if_fail (result_uri != NULL, GNOME_VFS_ERROR_BAD_PARAMETERS);
 
@@ -323,7 +323,13 @@
  * we want to look at the device the symlink points to, not the one the
  * symlink is stored on
  */
+ parent_uri = gnome_vfs_uri_get_parent (near_uri);
+ if (parent_uri) {
+ gnome_vfs_uri_unref (near_uri);
+ near_uri = parent_uri;
+ }
  result = _gnome_vfs_uri_resolve_all_symlinks_uri (near_uri, &resolved_uri);
+
  if (result == GNOME_VFS_OK) {
  gnome_vfs_uri_unref (near_uri);
  near_uri = resolved_uri;


_______________________________________________
gnome-vfs-list mailing list
gnome-vfs-list@...
http://mail.gnome.org/mailman/listinfo/gnome-vfs-list

Re: [PATCH] gnome_vfs_find_directory should use the parent uri when possible

by Yann Rouillard :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

This patch was recently applied but has several side effects. Please
read my comment on the bug report:
http://bugzilla.gnome.org/show_bug.cgi?id=312506#c27

Yann

Yann Rouillard wrote:

> The attached patch changes the gnome_vfs_find_directory_cancellable function so the parent_uri is used to find the special directory instead of the given uri.
> It is needed to properly find the trash for a symlink whose target is on another filesystem.
>
> Otherwise, as the uri is resolved, the trash for the filesystem of the symlink target is returned instead of the trash for the filesystem of the symlink itself.
>
> This patch solves the bugzilla issue: http://bugzilla.gnome.org/show_bug.cgi?id=312506
> and tries to follow Alexander Larsson advice: http://mail.gnome.org/archives/nautilus-list/2005-October/msg00159.html
>
>
> Yann
>
>
>  

_______________________________________________
gnome-vfs-list mailing list
gnome-vfs-list@...
http://mail.gnome.org/mailman/listinfo/gnome-vfs-list
LightInTheBox - Buy quality products at wholesale price!