Re: Question about background items in a nautilus-menu-provider extension
- From: Colomban Wendling <lists ban herbesfolles org>
- To: nautilus-list gnome org
- Subject: Re: Question about background items in a nautilus-menu-provider extension
- Date: Wed, 24 Feb 2010 17:51:16 +0100
Hi,
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
>> directory,
>> and that the passed NautilusFileInfo is not NULL only once; And the
>> time
>> 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
background one.
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!
Regards,
Colomban
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]