Re: [PATCH] Same filesystem drag-and-drop of a readonly file should gracefully degrade to a "copy"



2008/10/3 Alexander Larsson <alexl redhat com>
On Thu, 2008-10-02 at 12:56 +0200, Nelson Benítez León wrote:
> Hi!, I've posted a new patch in here[1] , the bug is about when
> drag'n'drop a file from a readonly location like "/etc" to some user
> folder, with the patch we change the drop action to COPY instead of
> MOVE, because the later causes an error due to "/etc" being
> readonly ...

I like it. A few comments though:

+source_parent_is_writable_ (GFile *file)

Whats with the ending underscore?

 I used the underscore to not have the same name for the function and the var, I've now changed the var name instead...


I think its generally better to go via nautilus_file_get_existing() and
then nautilus_file_get_parent() since then we allocate one less GFile
and terminate earlier in the doesn't-exist case.

 It allocates one less GFile pointer but one more NautilusFile pointer, don't know if that's a gain, I've changed it anyway...


Using is_writable isn't actually 100% correct, as on some filesystem the
move attribute may not be controlled by the "writable" bit on a
directory. For instance on a non-posix filesystem with a more
complicated permissions system. However, I think its good enough, and if
you really want to move you can force via holding down the move
modifier.


  Ok, updated patch is attached.

Attachment: writable3.diff
Description: Binary data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]