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 510401 - Drop gnome-vfs dependency
Drop gnome-vfs dependency
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
unspecified
Other Linux
: Urgent critical
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on: 512691
Blocks:
 
 
Reported: 2008-01-18 14:12 UTC by Cosimo Cecchi
Modified: 2008-01-30 20:41 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
gio-migration v1 (43.27 KB, patch)
2008-01-21 01:38 UTC, Cosimo Cecchi
needs-work Details | Review
gio-migration v2 (4.76 KB, patch)
2008-01-24 19:07 UTC, Cosimo Cecchi
none Details | Review
gio-migration v3 (3.14 KB, patch)
2008-01-29 11:53 UTC, Cosimo Cecchi
none Details | Review
gio-migration v4 (3.32 KB, patch)
2008-01-30 13:18 UTC, Cosimo Cecchi
committed Details | Review

Description Cosimo Cecchi 2008-01-18 14:12:04 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.
Comment 1 Cosimo Cecchi 2008-01-21 01:38:13 UTC
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 :)
Comment 2 Cosimo Cecchi 2008-01-21 11:03:15 UTC
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).
Comment 3 Wouter Bolsterlee (uws) 2008-01-23 17:04:52 UTC
(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?
Comment 4 Cosimo Cecchi 2008-01-23 19:09:04 UTC
(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).
Comment 5 Wouter Bolsterlee (uws) 2008-01-24 14:22:28 UTC
(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.
Comment 6 Cosimo Cecchi 2008-01-24 19:07:16 UTC
Created attachment 103659 [details] [review]
gio-migration v2

Fix some leaks and use g_file_copy_async ().
Comment 7 Carlos Garcia Campos 2008-01-25 12:31:42 UTC
I've fixed several issues found in the patch and committed it to svn trunk. Thank you very much for the patch. 
Comment 8 Nickolay V. Shmyrev 2008-01-28 22:57:21 UTC
Issues - 

1)content mime type detection doesn't work. Our third test is broken. 
2)we rely on unreleased glib version
Comment 9 Cosimo Cecchi 2008-01-29 00:07:50 UTC
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.
Comment 10 Cosimo Cecchi 2008-01-29 09:35:51 UTC
(In reply to comment #8)

> 2)we rely on unreleased glib version

GLib 2.15.4 was released tonight.
Comment 11 Cosimo Cecchi 2008-01-29 11:53:54 UTC
Created attachment 103953 [details] [review]
gio-migration v3

Attached patch use g_content_type_guess () to make mime handling work properly again.
Comment 12 Wouter Bolsterlee (uws) 2008-01-29 12:19:56 UTC
(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.
Comment 13 Cosimo Cecchi 2008-01-30 13:18:26 UTC
Created attachment 104026 [details] [review]
gio-migration v4

You're right. This patch fixes that and hopefully all other leaks in that section.
Comment 14 Wouter Bolsterlee (uws) 2008-01-30 20:29:20 UTC
I'm not sure whether it applies cleanly to SVN, but if you fixed the memory leaks, feel free to commit.
Comment 15 Cosimo Cecchi 2008-01-30 20:41:44 UTC
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.