diff options
author | Perberos <[email protected]> | 2012-02-22 01:57:06 -0300 |
---|---|---|
committer | Perberos <[email protected]> | 2012-02-22 01:57:06 -0300 |
commit | 341fc293a5edc0dda25c4a8d465d19bd293fb6da (patch) | |
tree | c5890be2a057599ee512e2cbf54dfb5b17e93a57 /mate-about/mate-about.c | |
parent | c72d30463c6def093499fac8b4b55885975e799d (diff) | |
download | mate-desktop-341fc293a5edc0dda25c4a8d465d19bd293fb6da.tar.bz2 mate-desktop-341fc293a5edc0dda25c4a8d465d19bd293fb6da.tar.xz |
GOptionEntry was added on glib 2.6
Diffstat (limited to 'mate-about/mate-about.c')
-rw-r--r-- | mate-about/mate-about.c | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/mate-about/mate-about.c b/mate-about/mate-about.c index 67afb72..f40c689 100644 --- a/mate-about/mate-about.c +++ b/mate-about/mate-about.c @@ -229,15 +229,38 @@ mate_gettext(GETTEXT_PACKAGE, LOCALE_DIR, "UTF-8"); g_type_init(); - /* http://www.gtk.org/api/2.6/glib/glib-Commandline-option-parser.html */ - GOptionContext* context = g_option_context_new(NULL); - g_option_context_add_main_entries(context, command_entries, GETTEXT_PACKAGE); - g_option_context_add_group(context, gtk_get_option_group(TRUE)); - g_option_context_parse(context, &argc, &argv, NULL); - - /* Not necesary at all, program just run and die. - * But it free a little memory. */ - g_option_context_free(context); + + + #ifdef G_OPTIONS_ENTRY_USE + /* http://www.gtk.org/api/2.6/glib/glib-Commandline-option-parser.html */ + GOptionContext* context = g_option_context_new(NULL); + g_option_context_add_main_entries(context, command_entries, GETTEXT_PACKAGE); + g_option_context_add_group(context, gtk_get_option_group(TRUE)); + g_option_context_parse(context, &argc, &argv, NULL); + + /* Not necesary at all, program just run and die. + * But it free a little memory. */ + g_option_context_free(context); + #else + int opt; /* este valor entrega el tipo de argumento */ + + while ((opt = getopt_long(argc, argv, "+", command_entries, NULL)) != -1) + { + switch (opt) + { + case '?': + return 1; + case OPTION_VERSION: + mate_about_nogui = TRUE; + break; + #ifdef CMDLINE_PROCESS + CMDLINE_PROCESS + #endif + } + } + #endif + + if (mate_about_nogui == TRUE) { |