Re: URIs, D&D and bug #48423



On 21 May 2002, Michael Meeks wrote:

> Hi there,
> 
> 	I was wondering what the status of this comment:
> 
> nautilus-dnd.c (add_one_compatible_uri):
> 
> /* Encode a "text/plain" selection; this is a broken URL -- just
>  * "file:" with a path after it (no escaping or anything). We are
>  * trying to make the old gnome_uri_list_extract_filenames function
>  * happy, so this is coded to its idiosyncrasises.
>  */
> 
> 	Is. I ask this because in bug #48423, we blindly accept that the
> incoming URI in the D&D list is in fact a URI, and not a mangled
> filename. And we emit a 'location_changed' signal with it as the string,
> all of which ends up doing:

Oh. It's this old crap.

I don't think we should be sending broken URI-lists like that. We should 
be using g_filename_to_uri() so all apps use the same way of encoding the 
URIs. We spent a lot of time getting the behaviour of that function right, 
and it's what the Gtk+ fileselector uses for DnD.

> 	Which for the un-initiated means that this unescaped (%20 for spaces)
> URI goes into the nautilus-directory as a separate entry from the
> (pre-existing) properly escaped entry of the same name.
> 
> 	What should be done about that ? would a correct fix be to use
> eel_make_uri_from_input on the incoming URIs ?

No. We should probably use g_filename_from_uri(), and then fix all apps 
that send broken URI-lists. 

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a fast talking dishevelled dwarf from the Mississippi delta. She's a 
provocative paranoid Valkyrie who believes she is the reincarnation of an 
ancient Egyptian queen. They fight crime! 




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