Re: Nautilus location bar



On Thu, 2007-01-11 at 22:19 +0300, Виталий Ищенко wrote:
> В Чтв, 11/01/2007 в 12:12 +0100, Alexander Larsson пишет:
> > Really, we should have a function in gnome vfs that you pass the
> > current
> > uri too so it correctly handles relative uris.
> I though that gnome_vfs_uri_resolve_relative should do this kind of
> things...
> But after reading doc's for this function, i can't understand
> following paragraph:
>   Otherwise, depending on its precise syntax, it
>   inherits some aspects of the parent URI, but the
>   parents' fragment and query components are ignored.
> Does it means, that '..' & '.' won't be expanded?

gnome_vfs_uri_resolve_relative has a very specific usecase. Its when you
find a (possibly relative) uri in e.g. a html page that you want to
resolve to an absolute one (given the uri of the page). Its not at all
useful for input of "uris" (which might be filenames or invalid uris).

> > Changing the cwd like
> > that is not threadsafe and quite ugly.
> Yeah, I know it's ugly fix =)
> 
> Could nautilus_location_bar_get_location (...) look like this:
> 
> Or i'm missing something?

It seems wrong in several ways. First of all you always convert input to
the local filename encoding which is not what uris in general use. Then
you feed a random inputed string which might not be a uri into
gnome_vfs_uri_resolve_relative. 

gnome_vfs_make_uri_from_input() was specially designed for exactly the
case of taking a randomly inputed location bar string (in utf8) and try
to make a uri of it. Why are you trying to do something strange instead?

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a globe-trotting alcoholic gentleman spy living undercover at Ringling 
Bros. Circus. She's a scantily clad streetsmart socialite with an evil twin 
sister. They fight crime! 




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