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 338954 - Use GOption argument parsing instead of popt
Use GOption argument parsing instead of popt
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: general
unspecified
Other All
: Normal enhancement
: ---
Assigned To: General Totem maintainer(s)
General Totem maintainer(s)
: 344308 (view as bug list)
Depends on:
Blocks: 160807
 
 
Reported: 2006-04-19 01:11 UTC by Luis Menina
Modified: 2006-11-29 19:23 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Incorrect patch (19.98 KB, patch)
2006-04-19 01:20 UTC, Luis Menina
none Details | Review
use goption in the mozilla viewer (10.88 KB, patch)
2006-09-02 19:22 UTC, Christian Persch
committed Details | Review
totem-goption.patch (18.74 KB, patch)
2006-11-29 18:36 UTC, Bastien Nocera
needs-work Details | Review

Description Luis Menina 2006-04-19 01:11:33 UTC
Following these guidelines:
http://live.gnome.org/GnomeGoals/PoptGOption
Comment 1 Luis Menina 2006-04-19 01:20:58 UTC
Created attachment 63839 [details] [review]
Incorrect patch

This is a first try, as totem option parsing was done manually. 
It's being rewritten using GOption.
Comment 2 Luis Menina 2006-04-19 01:23:19 UTC
The "FIXME"'s in the patch are the parts i'm currently struggling with... if someone has some hints, i'd be grateful ;-)
Comment 3 Christian Persch 2006-04-19 11:19:23 UTC
+	totem->seek_to = options->seek; /* FIXME: Should be a GINT64, but GOptions doesn't support it ATM */

You should file a bug on glib for that... 
In the mean time, you can use a G_OPTION_ARG_CALLBACK argument for this and parse the value yourself there.

+  /* FIXME: Hangs since popt->GOption migration, can this be removed safely ? */
   g_once (&bvw_init_once, (GThreadFunc) bacon_video_widget_init_gst, NULL);

Depending on when it needs to be run, you could call bacon_video_widget_init_gst into the returned option groups's pre or post-parse hook.

+#if 0 /* FIXME: how to handle non totem options with goption ? */
Are there any options left that aren't handled by the gst optiong group, or the automatically used (via gnome_program_init) libgnome/libgnomeui/libbonobo/libbonoboui options groups?
Comment 4 Bastien Nocera 2006-06-20 08:29:02 UTC
*** Bug 344308 has been marked as a duplicate of this bug. ***
Comment 5 Baptiste Mille-Mathias 2006-08-10 19:32:49 UTC
Hey Luis, I hope you're fine.
Can we have information or an the update on the patch ?

tx
Comment 6 Luis Menina 2006-08-13 16:22:42 UTC
Hi Baptiste!
Well, kinda dropped the patch because option management in totem is kinda weird with the bacon init thingy... I think I can't have it working on my own. I have changed a few things in it (for example the GINT64 type is now supported by goption), but the g_once problem still remains, and without knowing the underlying code, I'm afraid of breaking some stuff... I'll soon post here my latest version, if someone wants to start from it.
Comment 7 Christian Persch 2006-09-02 19:22:51 UTC
Created attachment 72089 [details] [review]
use goption in the mozilla viewer

Here's a patch to implement goption parsing for the plugin/mozilla-viewer.
Comment 8 Bastien Nocera 2006-09-22 15:47:06 UTC
(In reply to comment #7)
> Created an attachment (id=72089) [edit]
> use goption in the mozilla viewer
> 
> Here's a patch to implement goption parsing for the plugin/mozilla-viewer.

s/DASH_DASH/DASHES/ so it's easier to type ;)

Otherwise looks good to commit.

Luis, I'll look at your patch this week-end.
Comment 9 André Klapper 2006-11-29 15:17:59 UTC
hadess: *ping* - can you take a look at the patch?
i'd like to get this gnomegoal solved... thanks. :-)
Comment 10 Bastien Nocera 2006-11-29 18:36:08 UTC
Created attachment 77361 [details] [review]
totem-goption.patch

Updated for the current code base. It tries to play the binary though... Weird.
Comment 11 Bastien Nocera 2006-11-29 19:23:34 UTC
The option parsing for when we're a server is still completely busted, and needs fixing. It's in bug #380617 for now, as I'm off to the pub!

2006-11-29  Bastien Nocera  <hadess@hadess.net>

        * configure.in: upd the glib and libgnome requirements
        * src/backend/bacon-video-widget-gst-0.10.c:
        (bacon_video_widget_get_option_group),
        (bacon_video_widget_init_backend):
        * src/backend/bacon-video-widget.h:
        * src/totem-options.c: (totem_options_process_late),
        (totem_options_process_early), (totem_options_process_for_server):
        * src/totem-options.h:
        * src/totem-private.h:
        * src/totem-session.c: (totem_save_yourself_cb),
        (totem_session_setup), (totem_session_restore):
        * src/totem-session.h:
        * src/totem-video-indexer.c: (main):
        * src/totem-video-thumbnailer.c:
        * src/totem.c: (main): Adapted patch from Luis Menina
        <liberforce@fr.st> to port the main movie player, and the indexer         to GOption (Closes: #338954)