Question about background items in a nautilus-menu-provider extension



Hi,

I'm writing a nautlus-menu-provider C extension, with
libnautilus-extension; and my file items works perfectly, but I have a
problem with background items. Let's tell the story.

I (of course) need Nautilus' window and the list of selected
files/directories to work on when the user activates my menu item. To do
so, I managed to attach data to the menu item (with
g_object_set_data_full()) and get it in my NautilusMenuItem::activate
handler. This works perfectly for the files item (the items I send in
response to get_file_items()) - I don't have to care about multiple
nautilus windows at all, it would even support multiple menus poped up
at once.

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?

Thanks by advance!

Regards,
Colomban


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]