GNOME Bugzilla – Bug 343894
Programs Handler should notice newly installed programs
Last modified: 2011-07-10 02:26:06 UTC
If a user leaves deskbar-applet running for a long time, they might find themselves being forced to restart it in order for some handlers (like the programs handler) to reload their indexes and include more current information. They should use the Watcher class to notice and re-index changes in the users application directory.
I'm not sure we want to do this inside deskbar ? Can we watch a directory which is not user's ? That makes ~5 directories to watch for new file, and modifications (update). I accept patches :)
I wanted to make sure that it was something you would accept patches for first :). My only question is, do you have anywhere else in the code that you use the watch class? I wouldn't mind implementing this, I just would like an example of where else its done in the code.
Great ! The Watcher class is used in the epiphany.py handler to watch the bookmark file for example. It's also used elsewhere, but i can't remember, i sugest grepping for 'Watcher' I don't think we use the Directory watcher, so you might need to experiment a bit on how it reacts to new files, or modified files.. Also if possible try to reindex only what is needed, since it will be blocking for the UI if you reload all .desktop files on each change..
Ok, well my initial attempts aren't going so well, what I was hoping could be a short addition of a watch and a callback isn't doing its job quite right. Anyone can feel more than free to do as they wish with this. I probably won't have the time to learn as much python as i would need for this.
Not a big problem, i can mark this as gnome-love task, since it should be fairly straight forwad to write (testing is another matter). But as i said above, i don't know if it's fully feasible..
Targeting for 2.24.
Hi, I'm trying to work on this bug but I need more information to go forward. The programs handler seems to be able to detect newly installed desktop application, on the fly. So, I suppose that the problem could be related to efficiency of the index after to much time of execution, but I don't know how many hours are sufficient to reproduce the wrong behavior. Also, what directories we should watch? As the index is only about desktop applications, I think that we need only the directories returned by get_xdg_data_dirs(), but I'm not sure about that.
You should look for new .desktop files. Have a look at ProgramsHandler._scan_desktop_files in programs.py. So you're right, you should watch all directories get_xdg_data_dirs() returns. Currently, we don't monitor those directories. Basically, you have to setup up a monitor and delete/add items to the index when an .desktop file has been removed/added. To monitor directories you can either use gnomevfs or gio. The problem is that gnomevfs is deprecated and in order to use gio you have to use pygobject from svn. I started a gio port in a separate branch at https://code.launchpad.net/~marduk-k-d-w/deskbar-applet/gio-port, but wasn't able to test it properly, yet. If you decide to use gnomevfs I'm going to port it to gio sooner or later. If you want to use gio the changes might not land in final 2.24 release. Either way, your contributions are highly appreciated.
To me, work on an implementation based on gio sounds more logical than work with a deprecated gnomevfs. If you agree with the risk of not launch this feature in 2.24 release, I'll start working in implementation based on gio immediatly.
Sure. That way you can test the gio branch for me :)
If you still want to work on it, I just merged the gio port into svn trunk.
deskbar-applet development has been stalled [1]. Maintainers don't have future development plan so i am closing the bugs as WONTFIX. [1] http://mail.gnome.org/archives/desktop-devel-list/2011-June/msg00073.html