Re: How to get NautilusFileInfo, to call nautilus_file_info_add_emblem()?



On Wed, 2009-08-26 at 11:39 -0700, Jack Bates wrote:
> How can I add an emblem to a file?
> 
> I gather from the Nautilus reference manual that once I have a
> NautilusFileInfo object, I can call nautilus_file_info_add_emblem(),
> http://library.gnome.org/devel/libnautilus-extension/stable/libnautilus-extension-nautilus-file-info.html#nautilus-file-info-add-emblem
> 
> - but I can't figure out how to get a NautilusFileInfo object from a
> file path...
> 
> I want my program to be able to take a file path and an emblem name, and
> add the emblem to the file, e.g.

At the moment there is no way to get a NautilusFileInfo from a path/uri,
but this could be added. However NautilusFileInfo objects are not
persistant, so I don't think this will do what you want anyway. The
emblem will only be on the file as long as its kept in memory (i.e.
visible in some window).

However, with the latest version of nautilus you can use 
 gvfs-set-attribute -t stringv <filename> metadata::emblems "emblem"
to set the emblem for a file.




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