com gtk/php-gtk: Eliminate need for tag: ext/libglade/libglade.overrides

[email protected] (David Soria Parra) Sat, 05 Nov 2005 18:16:05 +0000
Newsgroups php.gtk.cvs
Message-ID <[email protected]>
Commit:    9e9140530ff1fa4997c265be4808cbd210ce2c75
Author:    Steph Fox <[email protected]>         Sat, 5 Nov 2005 18:16:05 +0000
Parents:   d269244c0570beb7e12de79522082ed36e0672a6
Branches:  master

Link:       http://git.php.net/?p=gtk/php-gtk.git;a=commitdiff;h=9e9140530ff1fa4997c265be4808cbd210ce2c75

Log:
Eliminate need for tag

Changed paths:
  M  ext/libglade/libglade.overrides


Diff:
9e9140530ff1fa4997c265be4808cbd210ce2c75
diff --git a/ext/libglade/libglade.overrides b/ext/libglade/libglade.overrides
index 74cf4c6..2818a05 100644
--- a/ext/libglade/libglade.overrides
+++ b/ext/libglade/libglade.overrides
@@ -169,6 +169,7 @@ static void phpg_glade_signal_connect_auto(const gchar *handler_name, GObject *o
     GClosure *closure = NULL;
     int handler_id, len = 0, connect_normal = 1;
     char *php_class = NULL, *php_method = NULL;
+    zend_class_entry *ce = NULL, **pce;
     TSRMLS_FETCH();
 
     /*
@@ -177,14 +178,15 @@ static void phpg_glade_signal_connect_auto(const gchar *handler_name, GObject *o
      * course, but those connections are much less useful.
      */
     if (strstr(handler_name, "::")) {
-        /* If the handler is prefixed by '-', use simple signal connection. */
-        if (handler_name[0] == '-') {
-            connect_normal = 0;
-            handler_name++;
-        }
         len = strcspn(handler_name, ":");
         php_class = safe_estrndup(handler_name, len);
         php_method = strstr(handler_name, "::") + 2;
+        if (zend_lookup_class(php_class, strlen(php_class), &pce TSRMLS_CC) == SUCCESS) {
+            ce = *pce;
+            if (ce->type == ZEND_INTERNAL_CLASS) {
+                connect_normal = 0;
+            }
+        }
         MAKE_STD_ZVAL(callback);
         array_init(callback);
         add_next_index_string(callback, php_class, 1);