GNOME Bugzilla – Bug 513852
Port (Migrate) Yelp from gnome-vfs to gio / gvfs
Last modified: 2008-05-23 18:39:41 UTC
(I can't find an open bug for this, so I'm posting this one.) Like other GNOME projects, Yelp should be migrated from gnome-vfs to gio/gvfs.
I thought I might try to help out by doing this. Please tell me if someone is already working on it.
Note: Perhaps the wiki page http://live.gnome.org/GioPort should have a link to this bug (or to another, more appropriate one, if I missed it)? Other projects have such links there.
After the recent thread on d-d-l, I looked a little at this. It doesn't seem too bad to do. The only places we use gnome-vfs (as far as I can tell) are in yelp-utils.c (to determine the mime type of files) and in yelp-window.c (to read and process html files).
If you want to give it a go, we'd be more than happy with a patch. Though, it won't go in until after 2.22 as this would be considered a new feature (to me at least).
Ok, good, I'll give it a shot.
Created attachment 104253 [details] [review]
migration to gio
I attached a patch for this bug, I hope this is helpful.
I'm not a maintainer but I read your patch and thought I could add some comments, in some lines you do:
+ g_object_unref (G_OBJECT (stream));
I think the cast is not necessary, just unref (stream) is good. (someone correct me if I'm wrong).
Also in src/yelp-toc-pager.c you seem to not be including <gio/gio.h>, just removing gnome-vfs:
--- src/yelp-toc-pager.c (revision 3060)
+++ src/yelp-toc-pager.c (working copy)
@@ -32,7 +32,6 @@
Created attachment 105012 [details] [review]
Improved patch to migrate to gio
You are right about both of these, I think, thanks. I attach a fixed patch.
Regarding the casts, I saw them in other code, and I assumed they were meant to prevent a warning... but it turns out no warning is generated, so I guess they are unnecessary.
Regarding yelp-toc-pager.c, yes, I forgot to add the include. The compiler didn't remind me, because for some reason yelp-toc-pager.c isn't actually compiled... I'm not sure why. (Perhaps some ./configure option is needed in order for it to be used, or something?)
yelp-*-pager files are dead code and will never be used. I should really remove them from SVN at some point.
Anyway, the patch looks good to my untrained eyes. If there are no objections, I'll commit this as soon as we branch 2.22. Thanks for the work :)
Patch committed. Many thanks.
2008-05-23 Don Scorgie <email@example.com>
* src/test-resolver.c (main):
* src/test-uri.c (main):
* src/yelp-main.c (main):
* src/yelp-toc-pager.c (process_omf_pending):
* src/yelp-utils.c (resolve_process_ghelp), (resolve_full_file):
* src/yelp-window.c (window_do_load_html), (window_print_page_cb):
Port to use gio instead of gnome_vfs
bug #513852 - patch from Alon Zakai