r18726 - gnucash/trunk/src/bin - Remove popt references

Geert Janssens gjanssens at code.gnucash.org
Wed Feb 24 15:51:15 EST 2010


Author: gjanssens
Date: 2010-02-24 15:51:15 -0500 (Wed, 24 Feb 2010)
New Revision: 18726
Trac: http://svn.gnucash.org/trac/changeset/18726

Modified:
   gnucash/trunk/src/bin/gnucash-bin.c
Log:
Remove popt references

- popt has been replaced with the GOption infrastructure.
So there's no need to include the popt.h file.
- Also rewritten the comment that was elaborating on popt
vs GOption
- Finally removed the loglevel option (which was excluded from
the compile anyway) that still referred to popt.

Modified: gnucash/trunk/src/bin/gnucash-bin.c
===================================================================
--- gnucash/trunk/src/bin/gnucash-bin.c	2010-02-24 20:47:47 UTC (rev 18725)
+++ gnucash/trunk/src/bin/gnucash-bin.c	2010-02-24 20:51:15 UTC (rev 18726)
@@ -25,7 +25,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <popt.h>
 #include <libguile.h>
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
@@ -197,21 +196,7 @@
     try_load_config_array(stylesheet_files);
 }
 
-/* Note: Command-line argument parsing for Gtk+ applications has
- * evolved.  Gtk+-2.4 and before use the "popt" method.  We use that
- * here for compatibility.  Gnome-2.4 has a way of wrapping the "popt"
- * method (using GNOME_PARAM_POPT_CONTEXT).  Its advantages are that
- * it adds help messages for sound and the crash-dialog.  Its
- * disadvantages are that it prints a rather messy usage message
- * with lots of '?v's and it doesn't allow us to describe the
- * [DATAFILE] argument in the usage.  Weighing those factors, we're
- * just going to use popt directly.
- *
- * Glib-2.6 introduced GOptionContext and GOptionGroup, which are
- * meant to replace popt usage.  In Gnome-2.14, the popt usage is
- * offically deprecated, and the GNOME_PARAM_GOPTION_CONTEXT can be
- * used.
- */
+/* Parse command line options, using GOption interface */
 
 static void
 gnucash_command_line(int *argc, char **argv)
@@ -250,18 +235,7 @@
             NULL
         },
 
-#if 0
         {
-            "loglevel", '\0', 0, G_OPTION_ARG_INT, &loglevel,
-            /* Translators: This is the command line option autohelp text; see popt(3) */
-            _("Set the logging level from 0 (least) to 6 (most)"),
-            /* Translators: Argument description for autohelp; see
-               http://developer.gnome.org/doc/API/2.0/glib/glib-Commandline-option-parser.html */
-            _("LOGLEVEL")
-        },
-#endif // 0
-
-        {
             "nofile", '\0', 0, G_OPTION_ARG_NONE, &nofile,
             _("Do not load the last file opened"), NULL
         },



More information about the gnucash-changes mailing list