[gjs] GI: use g_signal_parse_name instead of g_signal_lookup
- From: Johan Bilien <jobi src gnome org>
- To: svn-commits-list gnome org
- Subject: [gjs] GI: use g_signal_parse_name instead of g_signal_lookup
- Date: Tue, 24 Mar 2009 13:25:34 -0400 (EDT)
commit 3e4255afa2f884605b47ded91138848bab5ce507
Author: Johan Bilien <jobi litl com>
Date: Tue Mar 24 17:24:01 2009 +0000
GI: use g_signal_parse_name instead of g_signal_lookup
or we won't be find signal name which include the detail (notify::foo)
---
gi/object.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/gi/object.c b/gi/object.c
index da9c2e6..dbf8376 100644
--- a/gi/object.c
+++ b/gi/object.c
@@ -889,6 +889,7 @@ real_connect_func(JSContext *context,
gulong id;
guint signal_id;
const char *signal_name;
+ GQuark signal_detail;
*retval = INT_TO_JSVAL(0);
@@ -922,11 +923,14 @@ real_connect_func(JSContext *context,
return JS_FALSE;
}
- signal_id = g_signal_lookup(signal_name, G_TYPE_FROM_INSTANCE(priv->gobj));
- if (signal_id == 0) {
- gjs_throw(context, "No signal %s on object of type %s",
- signal_name,
- g_base_info_get_name((GIBaseInfo*) priv->info));
+ if (!g_signal_parse_name(signal_name,
+ G_OBJECT_TYPE(priv->gobj),
+ &signal_id,
+ &signal_detail,
+ FALSE)) {
+ gjs_throw(context, "No signal '%s' on object '%s'",
+ signal_name,
+ g_type_name(G_OBJECT_TYPE(priv->gobj)));
return JS_FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]