On Tue, 2005-06-07 at 12:03 -0400, Vincent Noel wrote:
> Hey Alex,
> 
> On 6/7/05, Alexander Larsson <[EMAIL PROTECTED]> wrote:
> > Ah, this is more problematic. We need to do some async i/o to actually
> > get the information from not-yet-read files. That makes things a lot
> > more complicated...
> I have attached a new patch that actually does this.
> 
> > > On 6/2/05, Alexander Larsson <[EMAIL PROTECTED]> wrote:
> > Do we really need to show it as opened?
> In the patch the regular icon for the visited folder is used (so it's
> the "computer" icon when visiting computer:///, etc)
> 
> > Maybe nautilus_icon_factory_get_pixbuf_for_file is the easiest one to
> > use in this case.
> I kept using nautilus_icon_factory_get_icon_for_file, as I couldn't
> pass GTK_ICON_SIZE_MENU to nautilus_icon_factory_get_pixbuf_for_file
> (it's a GtkIconSize and not a int).

+               nautilus_file_call_when_ready (file,
+                                              
NAUTILUS_FILE_ATTRIBUTE_IS_DIRECTORY,
+                                              
got_file_info_for_location_menu_callback,
+                                              menu_item);

This can cause problems if the menu goes away before the callback is
called. You need to ref the menu_item until the callback.

+               directory = nautilus_directory_get (location);
+               file = nautilus_directory_get_corresponding_file (directory);
+               vfs_result_code = nautilus_file_get_file_info_result (file);

This code leaks file.
Furthermore, you don't have to get the directory first, just get the
file with nautilus_file_get(). (This is in two places in the patch.)


Also, i got warnings like these:
(lt-nautilus:12401): Gtk-CRITICAL **: gtk_menu_shell_select_item: assertion 
`GTK_IS_MENU_ITEM (menu_item)' failed


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   [EMAIL PROTECTED]    [EMAIL PROTECTED] 
He's an old-fashioned Catholic librarian on the run. She's a mentally unstable 
wisecracking journalist on her way to prison for a murder she didn't commit. 
They fight crime! 

-- 
nautilus-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/nautilus-list

Reply via email to