Weird code in nautilus-file-get-internal(...) of nautilus-file.c



In my efforts to get Trash properties on the desktop to work I came across the following snippet in nautilus-file-get-internal(...)

<snip>
if (self_owned && directory != NULL) {
	file_name = nautilus_directory_get_name_for_self_as_new_file (directory);
	relative_uri = gnome_vfs_escape_string (file_name);
	g_free (file_name);
} else if (eel_uri_is_desktop (uri)) {
</snip>

The if statement is true for among others if you pass as uri "trash:" to nautilus_file_get_internal. directory then is a nautilus_directory object containing the trash directory. In that case
nautilus_directory_get_name_for_self_as_new_file then
returns g_strdup(_("Trash")). This seems a bit a weird to me, why would relative_uri need to change depending on your locale. Wouldn't a nautilus_directory_get_uri be more appropriate here. I made the change and didn't see any difference in the behavior of nautilus, but I thought I just let you know, because there might be a bug here which I do not understand.

Jaap

BTW nautilus_directory_get_name_for_self_as_new_file is only used in the above snippet of nautilus.





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