Ace
Ace

Reputation: 355

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 dynamically change the emblem of a file during synchronization. Like this:

effect I want

Is there any solution to this with Qt/C++?

Upvotes: 1

Views: 838

Answers (1)

gpoo
gpoo

Reputation: 8638

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.

Upvotes: 1

Related Questions