[pygobject/gsoc2009: 142/160] Get rid of setObjectHasNewConstructor
- From: Simon van der Linden <svdlinden src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pygobject/gsoc2009: 142/160] Get rid of setObjectHasNewConstructor
- Date: Fri, 14 Aug 2009 21:35:40 +0000 (UTC)
commit 60b90091aab37bad510d3bc76ed840ed3b193188
Author: Simon van der Linden <svdlinden src gnome org>
Date: Wed Aug 12 16:11:58 2009 +0200
Get rid of setObjectHasNewConstructor
gi/gimodule.c | 18 ------------------
gi/pygi-info.c | 2 ++
gi/types.py | 3 ---
3 files changed, 2 insertions(+), 21 deletions(-)
---
diff --git a/gi/gimodule.c b/gi/gimodule.c
index f5e44c3..5bbb561 100644
--- a/gi/gimodule.c
+++ b/gi/gimodule.c
@@ -100,25 +100,7 @@ out:
return info;
}
-static PyObject *
-_wrap_set_object_has_new_constructor(PyObject *self, PyObject *args)
-{
- PyObject *py_g_type;
- GType g_type;
-
- if (!PyArg_ParseTuple(args, "O:setObjectHasNewConstructor", &py_g_type)) {
- return NULL;
- }
-
- g_type = pyg_type_from_object(py_g_type);
- pyg_set_object_has_new_constructor(g_type);
-
- Py_INCREF(Py_None);
- return Py_None;
-}
-
static PyMethodDef _pygi_functions[] = {
- { "setObjectHasNewConstructor", (PyCFunction)_wrap_set_object_has_new_constructor, METH_VARARGS },
{ NULL, NULL, 0 }
};
diff --git a/gi/pygi-info.c b/gi/pygi-info.c
index 75b7f93..d1c9fee 100644
--- a/gi/pygi-info.c
+++ b/gi/pygi-info.c
@@ -1303,7 +1303,9 @@ _wrap_g_object_info_register_type (PyGIBaseInfo *self,
}
g_type = g_registered_type_info_get_g_type((GIRegisteredTypeInfo *)self->info);
+
pyg_register_object_type(g_type, type);
+ pyg_set_object_has_new_constructor(g_type);
Py_RETURN_NONE;
}
diff --git a/gi/types.py b/gi/types.py
index d400035..ecd3469 100644
--- a/gi/types.py
+++ b/gi/types.py
@@ -25,7 +25,6 @@ from new import instancemethod
import gobject
from ._gi import \
- setObjectHasNewConstructor, \
InterfaceInfo, \
ObjectInfo, \
StructInfo
@@ -96,8 +95,6 @@ class GObjectMeta(gobject.GObjectMeta, MetaClassHelper):
if (isinstance(cls.__info__, ObjectInfo)):
cls._setup_fields()
- if hasattr(cls, '__gtype__'):
- setObjectHasNewConstructor(cls.__gtype__)
cls.__info__.register_type(cls)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]