GNOME Bugzilla – Bug 148620
Non-file URIs not properly displayed
Last modified: 2004-12-22 21:47:04 UTC
- Go to "fonts:///" in Nautilus - Double-click on a font; fontilus opens - Visit the panel's recent-files menu and see "Bitstream%20Vera%20Sans" The problem occurs because: 1. egg_recent_view_gtk_new_menu_item() calls egg_recent_item_get_uri_for_display() 2. egg_recent_item_get_uri_for_display() calls gnome_vfs_format_uri_for_display("fonts:///Bitstream%20Vera%20Sans") 3. After making the URI canonical, this calls gnome_vfs_get_local_path_from_uri(). Since the URI is not a file:/// URI, the latter function returns NULL. 4. gnome_vfs_format_uri_for_display_internal() validates the URI for being UTF-8 (which it is), and returns it intact. 5. Back to egg_recent_view_gtk_new_menu_item() where we call g_path_get_basename("fonts:///Bitstream%20Vera%20Sans"). This just gets the string after the last slash, so it returns "Bitstream%20Vera%20Sans". The problem is that we are calling gnome_vfs_format_uri_for_display() on non-file URIs, and it doesn't do what we want there. The attached patch adds a function called egg_recent_item_get_short_name(), which gives you a string suitable for displaying in a menu or list. It uses some heuristics to figure out a valid UTF-8 name from the URI's short name.
Created attachment 29971 [details] [review] Patch with fix; adds egg_recent_item_get_short_name()
Bug #148808 is the corresponding bug for the panel.
Looks good
Thanks, committed.