[pygobject] Do not bind gobject_get_data() and gobject_set_data()
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Do not bind gobject_get_data() and gobject_set_data()
- Date: Wed, 4 Apr 2012 12:18:44 +0000 (UTC)
commit 24cc09a7105299805fcc5bc151f53ac69958d728
Author: Steve FrÃcinaux <code istique net>
Date: Wed Feb 9 18:37:33 2011 +0100
Do not bind gobject_get_data() and gobject_set_data()
They will basically cause a crash if misused, and you can always use a
python member attribute instead.
https://bugzilla.gnome.org/show_bug.cgi?id=641944
Signed-off-by: Martin Pitt <martinpitt gnome org>
gi/_gobject/pygobject.c | 40 ----------------------------------------
1 files changed, 0 insertions(+), 40 deletions(-)
---
diff --git a/gi/_gobject/pygobject.c b/gi/_gobject/pygobject.c
index 8020b40..92dc573 100644
--- a/gi/_gobject/pygobject.c
+++ b/gi/_gobject/pygobject.c
@@ -1417,44 +1417,6 @@ pygobject_thaw_notify(PyGObject *self, PyObject *args)
}
static PyObject *
-pygobject_get_data(PyGObject *self, PyObject *args)
-{
- char *key;
- GQuark quark;
- PyObject *data;
-
- if (!PyArg_ParseTuple(args, "s:GObject.get_data", &key))
- return NULL;
-
- CHECK_GOBJECT(self);
-
- quark = g_quark_from_string(key);
- data = g_object_get_qdata(self->obj, quark);
- if (!data) data = Py_None;
- Py_INCREF(data);
- return data;
-}
-
-static PyObject *
-pygobject_set_data(PyGObject *self, PyObject *args)
-{
- char *key;
- GQuark quark;
- PyObject *data;
-
- if (!PyArg_ParseTuple(args, "sO:GObject.set_data", &key, &data))
- return NULL;
-
- CHECK_GOBJECT(self);
-
- quark = g_quark_from_string(key);
- Py_INCREF(data);
- g_object_set_qdata_full(self->obj, quark, data, pyg_destroy_notify);
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-static PyObject *
pygobject_connect(PyGObject *self, PyObject *args)
{
PyObject *first, *callback, *extra_args;
@@ -2056,8 +2018,6 @@ static PyMethodDef pygobject_methods[] = {
{ "freeze_notify", (PyCFunction)pygobject_freeze_notify, METH_VARARGS },
{ "notify", (PyCFunction)pygobject_notify, METH_VARARGS },
{ "thaw_notify", (PyCFunction)pygobject_thaw_notify, METH_VARARGS },
- { "get_data", (PyCFunction)pygobject_get_data, METH_VARARGS },
- { "set_data", (PyCFunction)pygobject_set_data, METH_VARARGS },
{ "connect", (PyCFunction)pygobject_connect, METH_VARARGS },
{ "connect_after", (PyCFunction)pygobject_connect_after, METH_VARARGS },
{ "connect_object", (PyCFunction)pygobject_connect_object, METH_VARARGS },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]