After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 343894 - Programs Handler should notice newly installed programs
Programs Handler should notice newly installed programs
Status: RESOLVED WONTFIX
Product: deskbar-applet
Classification: Deprecated
Component: general
Git master
Other Linux
: Low enhancement
: 2.26
Assigned To: Helton Doria
Deskbar Applet Maintainer(s)
gnome[unmaintained]
Depends on:
Blocks:
 
 
Reported: 2006-06-05 10:10 UTC by Kevin Kubasik
Modified: 2011-07-10 02:26 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Kevin Kubasik 2006-06-05 10:10:31 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.
Comment 1 Raphael Slinckx 2006-06-05 11:31:04 UTC
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 :)
Comment 2 Kevin Kubasik 2006-06-05 11:42:42 UTC
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.
Comment 3 Raphael Slinckx 2006-06-05 12:28:45 UTC
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..

Comment 4 Kevin Kubasik 2006-06-05 13:04:14 UTC
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.
Comment 5 Raphael Slinckx 2006-06-05 14:13:51 UTC
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..
Comment 6 Sebastian Pölsterl 2008-07-21 17:34:11 UTC
Targeting for 2.24.
Comment 7 Helton Doria 2008-08-12 21:11:11 UTC
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.

Comment 8 Sebastian Pölsterl 2008-08-13 15:43:37 UTC
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.
Comment 9 Helton Doria 2008-08-13 20:53:04 UTC
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.
Comment 10 Sebastian Pölsterl 2008-08-13 21:32:01 UTC
Sure. That way you can test the gio branch for me :)
Comment 11 Sebastian Pölsterl 2008-11-01 13:52:56 UTC
If you still want to work on it, I just merged the gio port into svn trunk.
Comment 12 Akhil Laddha 2011-07-10 02:26:06 UTC
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