Warn if there already is a main group. (#170445, Jeff Franks)
authorMatthias Clasen <mclasen@redhat.com>
Tue, 15 Mar 2005 13:24:22 +0000 (13:24 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 15 Mar 2005 13:24:22 +0000 (13:24 +0000)
2005-03-15  Matthias Clasen  <mclasen@redhat.com>

* glib/goption.c (g_option_context_set_main_group): Warn
if there already is a main group.  (#170445, Jeff Franks)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-8
glib/goption.c

index beb5cf4..729a4aa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-03-15  Matthias Clasen  <mclasen@redhat.com>
+
+       * 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  <yosh@gimp.org>
 
        * tests/array-test.c: delete a bunch of dead code.
index beb5cf4..729a4aa 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-15  Matthias Clasen  <mclasen@redhat.com>
+
+       * 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  <yosh@gimp.org>
 
        * tests/array-test.c: delete a bunch of dead code.
index beb5cf4..729a4aa 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-15  Matthias Clasen  <mclasen@redhat.com>
+
+       * 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  <yosh@gimp.org>
 
        * tests/array-test.c: delete a bunch of dead code.
index beb5cf4..729a4aa 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-15  Matthias Clasen  <mclasen@redhat.com>
+
+       * 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  <yosh@gimp.org>
 
        * tests/array-test.c: delete a bunch of dead code.
index 13104f9..a8528de 100644 (file)
@@ -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;
 }