summaryrefslogtreecommitdiff
path: root/gobject/gsignal.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-10-29 07:37:07 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-10-29 07:37:07 +0000
commitfbe5df779cd39c9587f665118074ac828a805c26 (patch)
treefdc7b85ccdc2c6d7f3233b260da337eb4220f310 /gobject/gsignal.c
parent300e3bb247216fee40254822c2fb60a78a8ef21c (diff)
Fix problem where signals with "_" in them appeared twice in the result
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.
Diffstat (limited to 'gobject/gsignal.c')
-rw-r--r--gobject/gsignal.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gobject/gsignal.c b/gobject/gsignal.c
index 1a32234ba..48ad7c106 100644
--- a/gobject/gsignal.c
+++ b/gobject/gsignal.c
@@ -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;