Alexander Larsson a Ãcrit :
> On Wed, 2010-02-24 at 00:06 +0100, Colomban Wendling wrote:
>> But with background items, it doesn't seems to be that simple: the
>> NautilusFileInfo I have attached to the menu item is NULL. After a
>> little time at tracking the problem, I finally saw that
>> get_background_items() is called more than once for a single
>> and that the passed NautilusFileInfo is not NULL only once; And the
>> it is set is not the one that generates the item that Nautilus
>> actually use.
>> Then my questions:
>> Is this indented (and if yes, why?) or is it a subtle bug somewhere?
>> How extensions are supposed to handle this?
> That does indeed seem weird. I'd say its a bug of some sort. Which of
> the calls has a non-NULL FileInfo, the last one?
Hum, shame on me, forget that. To be sure of the response to give you, I
tried to reproduce it; and I found why I thought it was happening.
I have an item I want to appear both in background items and files ones,
and I have therefore written a thin wrapper that builds the item with
the right label, icon, etc. But I didn't thought Nautilus caches the
menu item *by its name*, and then my file item overwritten the
And since when bg menu is created/appears no files are selected, my bg
item was overwritten with the empty file one...
Perhaps the doc should make clear that the name is a unique identifier
for all Nautilus menus? But well, perhaps it's just me that is quite
stupid at this point.
So again, sorry for the noise, and thanks for the help!
nautilus-list mailing list