GNOME Bugzilla – Bug 349608
Monitor books and update when they change
Last modified: 2010-12-20 14:32:52 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"
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?
Created a separate bug for opening a book (bug #351734), easier to track that way.
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).
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.
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.
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!
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
Fixed in git master, will be available in devhelp 2.91.4