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 336146 - Change from popt to GOption parsing
Change from popt to GOption parsing
Status: RESOLVED FIXED
Product: seahorse
Classification: Applications
Component: general
git master
Other Linux
: Low enhancement
: 1.0.0
Assigned To: Seahorse Maintainer
Seahorse Maintainer
Depends on:
Blocks:
 
 
Reported: 2006-03-27 04:18 UTC by Adam Schreiber
Modified: 2006-12-21 22:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GOption patch (9.38 KB, patch)
2006-03-27 04:20 UTC, Adam Schreiber
needs-work Details | Review

Description Adam Schreiber 2006-03-27 04:18:23 UTC
http://live.gnome.org/GnomeGoals/PoptGOption
Comment 1 Adam Schreiber 2006-03-27 04:20:50 UTC
Created attachment 62086 [details] [review]
GOption patch

I did the src/main.c one first, the struct definition could probably be moved back into place at the top instead of inline. 6 of 1 ....

I really dislike that GOption doesn't let you set a value to be used if a option is used on the cmd line like popt does.
Comment 2 Stef Walter 2006-03-27 05:15:41 UTC
I guess we're okay with HEAD depending on GTK 2.6.2 or later... Seems okay to me, but configure.in would need updating.

Comment 3 Stef Walter 2006-03-27 13:41:19 UTC
This doesn't compile for me:

main.c:447: error: ‘GNOME_PARAM_GOPTION_CONTEXT’ undeclared (first use in this function)

 * I agree it would be nice to get the src/main.c definition back into place 
   at the top. 
 * Why did the default for seahorse-daemon change from daemonize to 
   not-daemonize?
 * Why do we set |import|, |encrypt| and all those guys only to then use them 
   to set |mode|. If we're gonna have 6 flag variables, then we may as well use 
   them directly.
Comment 4 Adam Schreiber 2006-03-27 14:54:50 UTC
(In reply to comment #3)
> This doesn't compile for me:
> 
> main.c:447: error: ‘GNOME_PARAM_GOPTION_CONTEXT’ undeclared (first use in
> this function)

Yeah, you need GNOME 2.14 to have that defined.

>  * I agree it would be nice to get the src/main.c definition back into place 
>    at the top. 

I'll work on this.

>  * Why did the default for seahorse-daemon change from daemonize to 
>    not-daemonize?

It's not that the default changed, just the test changed from true to false because GOption only sets booleans to true if the flag is set.  It's retarded but that's how it does it.

>  * Why do we set |import|, |encrypt| and all those guys only to then use them 
>    to set |mode|. If we're gonna have 6 flag variables, then we may as well use 
>    them directly.

I'll change that, I was thinking the same thing.  Boo GOption not being able to indicate which value to set.

Maybe we ought to file this bug away and file a bug with glib/GOption to allow the setting of a specified value.
Comment 5 Stef Walter 2006-03-27 15:39:34 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > main.c:447: error: ‘GNOME_PARAM_GOPTION_CONTEXT’ undeclared (first use in
> > this function)
> 
> Yeah, you need GNOME 2.14 to have that defined.

Yes, this particular box has GNOME 2.12. If there really is no way around this, then I guess no GOption for seahorse. 

> >  * Why did the default for seahorse-daemon change from daemonize to 
> >    not-daemonize?
> 
> It's not that the default changed, just the test changed from true to false
> because GOption only sets booleans to true if the flag is set.  It's retarded
> but that's how it does it.

Bummer, this breaks backwards compatibility. Again if there really is no way to do this, then I guess we'll have to stay with popt style parsing.
Comment 6 Adam Schreiber 2006-03-27 16:15:18 UTC
(In reply to comment #5)
> Bummer, this breaks backwards compatibility. Again if there really is no way to
> do this, then I guess we'll have to stay with popt style parsing.
> 
?? -d works like it always has for me.
Comment 7 Stef Walter 2006-03-27 16:34:50 UTC
Ah, I see. Well if you change the meaning of g_daemonize, then can you rename the variable to reflect what it's doing? 
Comment 8 André Klapper 2006-11-29 15:21:16 UTC
adam, nate, any news here to get some progress on this gnome goal?
Comment 9 Stef Walter 2006-11-29 16:22:21 UTC
Looks good to go now.... Although the patch will need to be brought up to date.
Comment 10 André Klapper 2006-11-29 18:53:46 UTC
(and i guess that configure.in should also include the libgnome-2.14 requirement)
Comment 11 Stef Walter 2006-12-21 21:30:47 UTC
2006-12-21  Nate Nielsen  <nielsen@memberwebs.com>

    * agent/seahorse-agent-main.c:
    * daemon/seahorse-daemon.c:
    * plugins/nautilus/seahorse-pgp-preferences.c:
    * plugins/nautilus/seahorse-tool.c: Use GOption for parsing command 
    line arguments. Fixes bug #336146
Comment 12 André Klapper 2006-12-21 22:46:19 UTC
thanks for getting this in;
i updated http://live.gnome.org/GnomeGoals/PoptGOption