Re: [Nautilus-list] Patch for custom icon
- From: Johan Dahlin <jdahlin telia com>
- To: Darin Adler <darin bentspoon com>
- Cc: nautilus-list lists eazel com
- Subject: Re: [Nautilus-list] Patch for custom icon
- Date: 24 Mar 2002 17:27:52 +0100
sön 2002-03-24 klockan 17.12 skrev Darin Adler:
>  > -	exactly_one = uris[0] != NULL && uris[1] == NULL;
>  > +	exactly_one = uris[0] != NULL && *uris[1] == 0;
> 
> What about the case where uris[1] is NULL? I think you want
> 
> 	exactly_one = uris[0] != NULL && (uris[1] == NULL || *uris[1] == 0);
> 
> No?
Probably better.
> 
>  > +				gchar *escaped_name;
> 
> In Nautilus, we don't use gchar, and we put all declarations at the top 
> of functions. See the Nautilus coding style guide in nautilus/doc for 
> details.
> 
>  > +				escaped_name = gnome_vfs_escape_host_and_path_string (uris[0]);
> 
> I'm not sure this is right. What if the URL is already escaped properly? 
> Then don't we have a problem where "%" characters will get turned into 
> "%25"?
> 
>  > +		escaped_name = gnome_vfs_escape_host_and_path_string (icon_uri);
> 
> This should be completely unnecessary. The URI that you get from 
> gnome_vfs_get_uri_from_local path shouldn't have any characters in it 
> that need escaping. Can you give me an example of where this is 
> necessary?
If a have a directory that's called
"Kristofer_Åström__Hidden_Truck-Nothern_Blues" and want to assign an
image called cover.jpg (in the same dir) to the directory
I'll get an error in the terminal:
xmlStringGetNodeList: invalid hexadecimal charvalue
And an entry in .nautilus-metafile.xml that looks like this:
<file name="Kristofer_%C5str%F6m__Hidden_Truck-Northern_Blues"    
custom_icon="file:/home/jdahlin/ljud/albums/Kristofer_ųtrHidden_Truck-Northern_Blues/cover.jpg"/>
With the patch, it'll look like this
<file name="Kristofer_%C5str%F6m__Hidden_Truck-Northern_Blues"  
custom_icon="file:/home/jdahlin/ljud/albums/Kristofer_%C5str%F6m__Hidden_Truck-Northern_Blues/cover.jpg"/>
name is already escaped properly i don't know why.
But you're probably right when you saying that it should be done in
another level, but my knowledge about nautilus code is limited, this
just worked.
--
Johan Dahlin
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]