Comment 2 for bug 491777

Revision history for this message
Roman Yepishev (rye) wrote :

#nautilus at irc.gnome.org:

alex: Alexander Larsson
rtg: me

<rtg> alex, it listens to DBus signals that say 'File is being uploaded', 'File is downloaded' and changes the emblems on the files that are mentioned in those signals
<alex> even if those files are not currently shown by nautilus?
<rtg> alex, hm...
<alex> rtg: The correct way to implement something like that is to request the NautilusFileInfo object for the uri that change, if it exists, and if so call a "refresh" operation on it
<alex> rtg: such support doesn't exist, but i'd be happy getting patches to add it
<rtg> alex, so it is possible..
<rtg> alex, :'-(
<alex> rtg: its possible, but requires patches
<rtg> alex, it stores the data in internal GHashTable and adds the emblems when update_file_info is called from Nautilus, so no, emblems are not added for everything and everywhere
* giusef has quit (Segmentation fault)
<alex> does it add a ref to the file? or does it handle it going away?
<alex> Anyway, if you do that then you have a ref to the NautilusFileInfo already
<alex> then you can do this
<alex> just call nautilus_file_info_invalidate_extension_info()
<alex> on the object and you'll get update_file_info added again, just return the new fresh data there
<alex> What we don't currently have is a way to get a reference to a NautilusFileInfo object for a particular uri/path
<rtg> alex, okay, so this will not affect, say, thumbnails, right?
<alex> no, it will delete all extension info on the file and ask all registered info providers for fresh info
<alex> rtg: However, you should make sure that you don't keep a ref on the NautilusFile, since that would cause a leak in nautilus
<rtg> alex, okay, I will add this to our ext bug report. Since we can keep a ref to the NautilusFileInfo as the hash table value for the URI, we might call the *invalidate_extension_info. Ok, thanks for your help!
<alex> rtg: you should use a weak ref so you can remove the NautilusFileInfo from the hash when nautilus no longer monitors the file