How to change the emblem of a file-icon with C/C++ in GNOME?
I'm developing an App which works like Dropbox. I want to dynami开发者_运维百科cally change the emblem of a file during synchronization. Like this:
Is there any solution to this with Qt/C++?
You do not need Qt for doing this. But you will need C calls to do it.
You can create an extension for Nautilus and use NautilusInfoProvider and NautilusFileInfo, in
particular nautilus_file_info_add_emblem()
.
If you implement NautilusInfoProvider and register your extension, then, Nautilus will
call nautilus_info_provider_update_file_info
. There you can implement the logic to check the file status and set the icon properly (with nautilus_file_info_add_emblem()
). However, I would recommend you to call that function when the application is idle.
精彩评论