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 516090 - Port to gio
Port to gio
Status: RESOLVED FIXED
Product: gnome-media
Classification: Deprecated
Component: general
2.20.x
Other Linux
: Normal normal
: ---
Assigned To: gnome media maintainers
gnome media maintainers
Depends on: 404877
Blocks:
 
 
Reported: 2008-02-12 19:41 UTC by Kalle Vahlman
Modified: 2008-08-29 14:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
audio profiles port to GIO (2.10 KB, patch)
2008-03-21 17:59 UTC, Gustavo Noronha (kov)
committed Details | Review
grecord window stuff ported to gio (3.36 KB, patch)
2008-03-21 21:11 UTC, Gustavo Noronha (kov)
none Details | Review
Another version of gio porting (3.04 KB, patch)
2008-03-25 19:21 UTC, Kalle Vahlman
none Details | Review
Another version of audio profiles gio porting (2.12 KB, patch)
2008-03-25 19:32 UTC, Kalle Vahlman
none Details | Review

Description Kalle Vahlman 2008-02-12 19:41:49 UTC
Gnome-media has gnome-vfs in grecord and the audio profiles dialog.

I'm taking a whack to switch them over to gio (and by the looks of it, to the new recent manager stuff as a consequence...).
Comment 1 Gustavo Noronha (kov) 2008-03-21 17:57:22 UTC
I have started some work on this front. I am attaching the patch to the audio profiles dialog right now, and am currently working on the do_save_file and fill_in_information functions of grecord/src/gsr-window.c files.
Comment 2 Gustavo Noronha (kov) 2008-03-21 17:59:57 UTC
Created attachment 107741 [details] [review]
audio profiles port to GIO
Comment 3 Gustavo Noronha (kov) 2008-03-21 21:11:31 UTC
Created attachment 107756 [details] [review]
grecord window stuff ported to gio

I had to write a custom function to format the size of the file to be human-readable, since I did not find anything in glib that does what gnome-vfs's gnome_vfs_format_file_size_for_display function does. A function like that should probably be merged into glib.
Comment 4 Marc-Andre Lureau 2008-03-21 21:25:28 UTC
excellent, altough I think there is still some todo left, and gnome-vfs is still a dependency: grecord/recent-files/egg-recent-item.c, & gnome_vfs_make_uri_from_shell_arg. 

Do you have plan to deprecate egg-recent too :)?
Comment 5 Gustavo Noronha (kov) 2008-03-25 13:49:08 UTC
That's the idea =).
Comment 6 Marc-Andre Lureau 2008-03-25 15:46:43 UTC
(In reply to comment #5)
> That's the idea =).
> 

note the dependency that I added: bug 404877, there is already some trial patch.
Comment 7 Kalle Vahlman 2008-03-25 19:21:22 UTC
Created attachment 108014 [details] [review]
Another version of gio porting

(In reply to comment #3)
> Created an attachment (id=107756) [edit]
> grecord window stuff ported to gio

Hrm, I actually had these done already a while ago but got swept away with work stuff and forgot to attach the patches...
 
> I had to write a custom function to format the size of the file to be
> human-readable, since I did not find anything in glib that does what
> gnome-vfs's gnome_vfs_format_file_size_for_display function does. A function
> like that should probably be merged into glib.

Already is, it's just not blatantly obvious in the docs:

-               human = gnome_vfs_format_file_size_for_display (file_size);
+               human = g_format_size_for_display (file_size);

Some comments on this patch:

+	if (src_gfile && dst_gfile) {

From the docs of g_file_new_*():

"Constructs a GFile for a given URI. This operation never fails [...]"

so in my opinion there is no point in checking if they failed, the function is guaranteed to always return a valid object. I've changed that if to directly test the result of the copy operation in my patch, which simplifies the code a bit. I'll attach my patch for reference.
Comment 8 Kalle Vahlman 2008-03-25 19:32:06 UTC
Created attachment 108016 [details] [review]
Another version of audio profiles gio porting

(In reply to comment #2)
> Created an attachment (id=107741) [edit]
> audio profiles port to GIO
> 

+    mime_type_description = g_content_type_get_description (temp_file_name);

Does this really work on unix? The content type is supposed to be a platform-specific string (mimetype on unix, suffix on windows), not a file name according to docs.

I think the proper way is to use g_content_type_guess() to get the content type and then use that to get the description. And apparently my patch leaks the description so it would need fixing too...
Comment 9 Gustavo Noronha (kov) 2008-03-26 22:10:27 UTC
I thought the same, but then I read the code for g_content_type_get_description, and decided it would work. I tried it, and it did. I think your grecord patch is more correct, though, and there's nothing I would change in it, so I'd advocate for your patch being applied.

I think my patch for audio-profiles is correct, though, and would be my choice.
Comment 10 Marc-Andre Lureau 2008-04-17 21:27:05 UTC
ok, just marking the patch as suggested by Gustavo. 
Comment 11 André Klapper 2008-06-22 16:45:40 UTC
*ping* - just asking for progress here to clean up our stack.
Comment 12 André Klapper 2008-07-19 10:32:57 UTC
*ping*
Comment 13 Andreas Proschofsky 2008-08-22 10:55:12 UTC
*ping* - gnome 2.24 is getting close and this should be fixed in advance
Comment 14 Marc-Andre Lureau 2008-08-22 11:37:21 UTC
(In reply to comment #13)
> *ping* - gnome 2.24 is getting close and this should be fixed in advance
> 

Please help to fix bug 404877 then.
Comment 15 Bastien Nocera 2008-08-29 14:15:43 UTC
2008-08-29  Bastien Nocera  <hadess@hadess.net>

	* configure.in:
	* profiles/audio-profile-choose.c (gm_audio_profile_choose_new):
	Patch from Gustavo Noronha <gns@gnome.org> to port the media profiles
	to use GIO (Helps: #516090)
Comment 16 Bastien Nocera 2008-08-29 14:27:21 UTC
The patch didn't apply cleanly anymore, was missing a declaration for utf8_name, as well as porting for gnome_vfs_make_uri_from_shell_arg().

2008-08-29  Bastien Nocera  <hadess@hadess.net>

        * configure.in: Port gnome-sound-recorder to GIO (Helps: #516090)

2008-08-29  Bastien Nocera  <hadess@hadess.net>

        * src/gsr-window.c (do_save_file), (fill_in_information),
        (play_cb): Port to GIO from gnome-vfs, based on patch by  Kalle
        Vahlman <zuh@iki.fi> (Helps: #516090)
Comment 17 Bastien Nocera 2008-08-29 14:32:51 UTC
2008-08-29  Bastien Nocera  <hadess@hadess.net>

	* configure.in: Remove last bit of gnome-vfs from the configure
	(Closes: #516090)