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 349608 - Monitor books and update when they change
Monitor books and update when they change
Status: RESOLVED FIXED
Product: devhelp
Classification: Applications
Component: General
git master
Other All
: Normal enhancement
: ---
Assigned To: devhelp-maint
devhelp-maint
Depends on:
Blocks:
 
 
Reported: 2006-08-01 23:36 UTC by Marc-Andre Lureau
Modified: 2010-12-20 14:32 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Marc-Andre Lureau 2006-08-01 23:36:56 UTC
Please add arguments to:

- update the library (you have to close every instance and restart devhelp to view additions/removals)

- open a .devhelp2 directly (without having to deal with the paths devhelp knows)

- may be add an environnement variable DEVHELP_HOME_PATH instead of using "~/.devhelp" directory ? if it's state, then use it, otherwise use "~/.devhelp"
Comment 1 Richard Hult 2006-08-03 07:43:00 UTC
Wouldn't it be better to add file monitors and reload when the files actually changes?

Opening a devhelp file could make sense, I'll look into that (or if someone else does it, it will probably happen sooner).

Do you mean  /.gnome2/devhelp? Why do you want that?

Comment 2 Richard Hult 2006-08-17 09:40:14 UTC
Created a separate bug for opening a book (bug #351734), easier to track that way.
Comment 3 Richard Hult 2006-08-17 09:43:05 UTC
Changing this bug into the first point only (the last one doesn't make sense to me, feel free to file a separate bug for that and explain it better).
Comment 4 Wouter Bolsterlee (uws) 2008-01-10 14:10:36 UTC
Perhaps adding watches on the directories containing the .devhelp files would suffice? That way you don't have to track all the open files...

Updating version.
Comment 5 Aleksander Morgado 2010-08-04 22:47:24 UTC
I started working on this, branch gb349608-monitor-book-updates in gitorious:
http://gitorious.org/devhelp/devhelp/commits/gb349608-monitor-book-updates

Still some work to do, but shouldn't take long to implement it properly.

The idea is to monitor both changes in the list of available books (new books added or books removed), and also changes in the existing books.
Comment 6 Aleksander Morgado 2010-12-02 23:01:59 UTC
Ok, so finally got time to implement this. All the work is in the gb349608-monitor-book-updates branch in gitorious:
http://gitorious.org/devhelp/devhelp/commits/gb349608-monitor-book-updates

In detail:
 * We monitor for new books available by monitoring the paths where the documentation directories are, for example: /usr/share/gtk-doc/html. We give a timeout of 5s to process the newly found book, just in case the process installing it needs time to create the dir (where we get the event) and actually install the .devhelp file.
 * We monitor for book updates (as when doing several continuous make installs of a project with documentation) directly in the .devhelp file. Book updates are processed removing the old book and adding a new one newly parsed.
 * We monitor for book removals also with the .devhelp file. If the file is removed, we consider the whole book removed.

One of the things I didn't like from my previous changes in the bookshelf was that whenever a book was enabled or disabled we were recreating from scratch the whole book tree and other things. This was an issue because if you had tree items expanded in the tree, as soon as you clear the tree and fill-in it again, you lost the expanded tree items So, I changed all that so that now the tree and all the other things (search combobox, preferences bookshelf list) are live-updated without needing to recreate them from scratch. This live-update applies to all books created, updated, deleted, enabled or disabled.

Comments welcome!
Comment 7 Aleksander Morgado 2010-12-16 21:10:45 UTC
This one, along with some other fixes, is available in the "improvements" branch in gitorious, the previous listed branch is obsolete:
http://gitorious.org/devhelp/devhelp/commits/improvements
Comment 8 Aleksander Morgado 2010-12-20 14:32:52 UTC
Fixed in git master, will be available in devhelp 2.91.4