Re: URIs vs. half-baked URIs [glib PATCH]



On Fri, 24 Aug 2001, Darin Adler wrote:

> On Friday, August 3, 2001, at 05:57  PM, Alex Larsson wrote:
> 
> > +    uri = g_strconcat ("file://", utf8_filename, NULL);
> 
> Is it better to use file:///etc rather than file:/etc (you have to chose 
> one as the canonical form when writing a function like this)?
>
> We did that in Nautilus and gnome-vfs, but I don't know why. If we make 
> the change to use the shorter version as the canonical form, we must be 
> careful to handle the hostname == "" case the same as the hostname == NULL 
> case.

I copied the current behaviour from gnome-vfs. Konqueror gives URIs like 
"file:/home/devel/alexl/all_types.c", maybe we should too.

In fact, I think I'll change it. (Unless people have strong opinions on 
this.)

> I'd like to see some tests, too. I don't like having a complicated 
> function like this without tests, especially since it's so easy to do 
> tests on a function that just deals with text and doesn't do any I/O or 
> user interaction. The gshell tests in glib have a nice idiom in there for 
> testing functions that return GError.

I will add some tests.

/ Alex






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