Re: [PATCH] Add DnD files onto archiver files with help of file-roller



On Sat, 2006-11-25 at 22:42 +0000, Nelson Benítez wrote:
> Alexander Larsson escribió:
> > On Sun, 2006-11-19 at 22:53 +0000, Nelson Benítez wrote:
> >> Hi, please see http://bugs.gnome.org/377157 for details and also a
> >> screencast of the feature. I also attach patch here.
> > 
> > Interesting. This interfers with implementing similar features using
> > chained uris. However, since those never really worked I guess we could
> > go this route instead.
> > 
> > nautilus_is_archiver_file() is pretty weird, it looks for e.e.g "zip"
> > anywhere in a filename, not ".zip" at the end. Also we should probably
> > be using mimetypes, not extensions if possible.
> 
> Now I added code so it looks for "zip" at the end of filename so now
> even 'photos.zip.backup' filename is not matched.
> I don't like very much using mimetypes because if I recall right mime
> functions make the code slow . Also strange things could happen like
> OpenOffice files are zip and so be offered as drop target, I think these
> well known archivers extensions are enough for the job, anyway I don't
> mind adding mime functions if you want that...

The way nautilus handles file types in general is through mimetypes. We
don't want to have everything use mimetypes except one place, because
that would make it act different in some particular case, completely
surprising users.

nautilus_drag_can_accept_files() gets passed a NautilusFile for the
possible drop object. We already know the mimetype of this and getting
it is the speed of strdup(). Furthermore, the OpenOffice zip example
above would affect *all* type handling in nautilus, and as such it is of
course handled correctly by that code already.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a benighted guitar-strumming cyborg on a mission from God. She's a 
sharp-shooting psychic angel from a family of eight older brothers. They fight 
crime! 




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