Fix problem where signals with "_" in them appeared twice in the result
authorOwen Taylor <otaylor@redhat.com>
Sun, 29 Oct 2000 07:37:07 +0000 (07:37 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Sun, 29 Oct 2000 07:37:07 +0000 (07:37 +0000)
Sun Oct 29 02:31:03 2000  Owen Taylor  <otaylor@redhat.com>

* gsignal.c (g_type_signals): Fix problem where signals
with "_" in them appeared twice in the result array.

gobject/ChangeLog
gobject/gsignal.c

index 4a01755e6cb8cc20d147185941f061cde89798d2..49e93e4dae4c556caf80fb2c981c960c8030692f 100644 (file)
@@ -1,3 +1,8 @@
+Sun Oct 29 02:31:03 2000  Owen Taylor  <otaylor@redhat.com>
+
+       * gsignal.c (g_type_signals): Fix problem where signals
+       with "_" in them appeared twice in the result array.
+
 Sun Oct 29 01:58:44 2000  Owen Taylor  <otaylor@redhat.com>
 
        * gsignal.h: Add g_type_signals() - a function to list
index 1a32234ba6608ecf4a6b6d2cf4c421b2797d0719..48ad7c1060ef7ec8bcdb6cf7deca10a8abf50684 100644 (file)
@@ -19,6 +19,8 @@
  * this code is based on the original GtkSignal implementation
  * for the Gtk+ library by Peter Mattis <petm@xcf.berkeley.edu>
  */
+#include <string.h> 
+
 #include        "gsignal.h"
 
 #include        "gbsearcharray.h"
@@ -718,7 +720,14 @@ g_type_signals (GType    itype,
   for (i = 0; i < n_nodes; i++)
     {
       if (keys[i].itype == itype)
-       g_array_append_val (result, keys[i].signal_id);
+       {
+         gchar *name = g_quark_to_string (keys[i].quark);
+         /* Signal names with "_" in them are aliases to the same
+          * name with "-" instead of "_".
+          */
+         if (!strchr (name, '_'))
+           g_array_append_val (result, keys[i].signal_id);
+       }
     }
 
   *n_ids = result->len;