From 4faa0650e54089bda119a7b93045c8e21d9946a1 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 15 Mar 2005 13:24:22 +0000 Subject: [PATCH] Warn if there already is a main group. (#170445, Jeff Franks) 2005-03-15 Matthias Clasen * glib/goption.c (g_option_context_set_main_group): Warn if there already is a main group. (#170445, Jeff Franks) --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-12 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ glib/goption.c | 7 +++++++ 5 files changed, 27 insertions(+) diff --git a/ChangeLog b/ChangeLog index beb5cf462..729a4aa5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-03-15 Matthias Clasen + + * glib/goption.c (g_option_context_set_main_group): Warn + if there already is a main group. (#170445, Jeff Franks) + Sun Mar 13 22:01:17 2005 Manish Singh * tests/array-test.c: delete a bunch of dead code. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index beb5cf462..729a4aa5a 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2005-03-15 Matthias Clasen + + * glib/goption.c (g_option_context_set_main_group): Warn + if there already is a main group. (#170445, Jeff Franks) + Sun Mar 13 22:01:17 2005 Manish Singh * tests/array-test.c: delete a bunch of dead code. diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index beb5cf462..729a4aa5a 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +2005-03-15 Matthias Clasen + + * glib/goption.c (g_option_context_set_main_group): Warn + if there already is a main group. (#170445, Jeff Franks) + Sun Mar 13 22:01:17 2005 Manish Singh * tests/array-test.c: delete a bunch of dead code. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index beb5cf462..729a4aa5a 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2005-03-15 Matthias Clasen + + * glib/goption.c (g_option_context_set_main_group): Warn + if there already is a main group. (#170445, Jeff Franks) + Sun Mar 13 22:01:17 2005 Manish Singh * tests/array-test.c: delete a bunch of dead code. diff --git a/glib/goption.c b/glib/goption.c index 13104f913..a8528de36 100644 --- a/glib/goption.c +++ b/glib/goption.c @@ -312,6 +312,13 @@ g_option_context_set_main_group (GOptionContext *context, g_return_if_fail (context != NULL); g_return_if_fail (group != NULL); + if (context->main_group) + { + g_warning ("This GOptionContext already has a main group"); + + return; + } + context->main_group = group; } -- 2.34.1