summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Henstridge <james@daa.com.au>2001-09-12 02:40:02 +0000
committerJames Henstridge <jamesh@src.gnome.org>2001-09-12 02:40:02 +0000
commit2312f49a82e5425b3d49d7f020586ac0625d75cc (patch)
tree117d5dea3eac4ac950b379d16cef856863522e68
parent8f1d6f32e1ba6b5c074fbc83034cf9cee0d5ea63 (diff)
downloadpygobject-short-class-names-branch.tar.gz
Also, changes to fix up pygtk-demo for this configuration.short-class-names-branch
2001-09-12 James Henstridge <james@daa.com.au> * codegen/codegen.py (write_class, write_interface): set the short name as the class name here. * gobjectmodule.c (pygobject_register_class): pass ec->tp_name as the name for the class passed to PyExtensionClass_Export*. * codegen/codegen.py (write_source): pass the C name to pygobject_register_class again.
-rw-r--r--gobject/gobjectmodule.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c
index 1f4ef7a0..9109b8e0 100644
--- a/gobject/gobjectmodule.c
+++ b/gobject/gobjectmodule.c
@@ -181,15 +181,17 @@ pygobject_destroy_notify(gpointer user_data)
}
static void
-pygobject_register_class(PyObject *dict, const gchar *class_name,
+pygobject_register_class(PyObject *dict, const gchar *type_name,
GType (* get_type)(void), PyExtensionClass *ec,
PyObject *bases)
{
PyObject *o;
+ const char *class_name;
if (!class_hash)
class_hash = g_hash_table_new(g_str_hash, g_str_equal);
+ class_name = ec->tp_name;
/* set standard pyobject class functions if they aren't already set */
if (!ec->tp_dealloc) ec->tp_dealloc = (destructor)pygobject_dealloc;
if (!ec->tp_getattro) ec->tp_getattro = (getattrofunc)pygobject_getattro;
@@ -210,7 +212,7 @@ pygobject_register_class(PyObject *dict, const gchar *class_name,
PyDict_SetItemString(ec->class_dictionary, "__gtype__", o);
Py_DECREF(o);
}
- g_hash_table_insert(class_hash, g_strdup(class_name), ec);
+ g_hash_table_insert(class_hash, g_strdup(type_name), ec);
}
void