GNOME Bugzilla – Bug 510401
Drop gnome-vfs dependency
Last modified: 2008-01-30 20:41:44 UTC
It would be good to drop Gnome-VFS dependency for Evince too, with the introduction of the gio API into Glib 2.15.x, which will be ready for GNOME 2.22. I'm working on a patch for this.
Created attachment 103297 [details] [review] gio-migration v1 Attached patch drops gnome-vfs dependency for Evince. It has a rough edge though: g_file_copy () is used in two places, when dealing with remote files, but we should really use g_file_copy_async () which is not yet implemented (but Alex told me will be soon). Other than this, comments and testing welcome :)
Also, I forgot to mention there's a place in the code where we want to launch an application with GAppInfo. In that case, we miss a GAppLaunchContext, and we can either c-p the code from EelAppLaunchContext (as we did in Epiphany) or just add a FIXME and add it for 2.24, when we could link to GTK+ 2.14 (which is what I did right now).
(In reply to comment #2) > Also, I forgot to mention there's a place in the code where we want to launch > an application with GAppInfo. In that case, we miss a GAppLaunchContext Does this introduce a regression?
(In reply to comment #3) > Does this introduce a regression? I think that may break multihead (i.e. launched application will not be launched on the same screen of Evince).
(In reply to comment #1) > It has a rough edge though: g_file_copy () is used in two places, when dealing > with remote files, but we should really use g_file_copy_async () which is not > yet implemented (but Alex told me will be soon). This is implemented now. See bug #511580.
Created attachment 103659 [details] [review] gio-migration v2 Fix some leaks and use g_file_copy_async ().
I've fixed several issues found in the patch and committed it to svn trunk. Thank you very much for the patch.
Issues - 1)content mime type detection doesn't work. Our third test is broken. 2)we rely on unreleased glib version
1) should be a glib bug, I filed bug #512691 for it. 2) is this a problem in trunk? GLib 2.16.0 will be out before 2.22.
(In reply to comment #8) > 2)we rely on unreleased glib version GLib 2.15.4 was released tonight.
Created attachment 103953 [details] [review] gio-migration v3 Attached patch use g_content_type_guess () to make mime handling work properly again.
(In reply to comment #11) > Attached patch use g_content_type_guess () to make mime handling work properly > again. You don't seem to free the 1024 byte buffer you allocated.
Created attachment 104026 [details] [review] gio-migration v4 You're right. This patch fixes that and hopefully all other leaks in that section.
I'm not sure whether it applies cleanly to SVN, but if you fixed the memory leaks, feel free to commit.
Committed, closing this as FIXED. 2008-01-30 Cosimo Cecchi <cosimoc@svn.gnome.org> * libdocument/ev-document-factory.c: (throw_unknown_mime_type_error), (throw_failed_to_get_info_error), (get_document_from_uri): Use g_content_type_guess () to get mimetype for files. Bug #510401.