aboutsummaryrefslogtreecommitdiffstats
path: root/libpyside/qslot.cpp
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-08-26 15:23:23 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-08-26 16:21:41 -0300
commita2f3e249bc0543b522c7d0e516dd07326e3ea7de (patch)
treee9dc91414290d52138632821e0bcc2231cd8950b /libpyside/qslot.cpp
parent268bf7735b787d2310e18b3aed262bd27b9d24c6 (diff)
Fixed slot singature parse function to keep compatibility with QSignal.
Fixes bug #319 Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'libpyside/qslot.cpp')
-rw-r--r--libpyside/qslot.cpp20
1 files changed, 4 insertions, 16 deletions
diff --git a/libpyside/qslot.cpp b/libpyside/qslot.cpp
index e74838cf4..c471cbb30 100644
--- a/libpyside/qslot.cpp
+++ b/libpyside/qslot.cpp
@@ -53,8 +53,8 @@ extern "C"
static int slot_init(PyObject*, PyObject*, PyObject*);
static PyObject* slot_call(PyObject*, PyObject*, PyObject*);
-//aux
-static char* slot_get_type_name(PyObject*);
+//external qsignal.cpp
+extern char* get_type_name(PyObject*);
// Class Definition -----------------------------------------------
@@ -120,18 +120,6 @@ void init_slot(PyObject *module)
} // extern "C"
-char* slot_get_type_name(PyObject *type)
-{
- if (PyType_Check(type)) {
- //tp_name return the full name
- Shiboken::AutoDecRef typeName(PyObject_GetAttrString(type, "__name__"));
- return strdup(PyString_AS_STRING(typeName.object()));
- } else if (PyString_Check(type)) {
- return strdup(PyString_AS_STRING(type));
- }
- return 0;
-}
-
int slot_init(PyObject *self, PyObject *args, PyObject *kw)
{
static PyObject *emptyTuple = 0;
@@ -148,7 +136,7 @@ int slot_init(PyObject *self, PyObject *args, PyObject *kw)
SlotData *data = reinterpret_cast<SlotData*>(self);
for(Py_ssize_t i = 0, i_max = PyTuple_Size(args); i < i_max; i++) {
PyObject *argType = PyTuple_GET_ITEM(args, i);
- char *typeName = slot_get_type_name(argType);
+ char *typeName = get_type_name(argType);
if (typeName) {
if (data->args) {
data->args = reinterpret_cast<char*>(realloc(data->args, (strlen(data->args) + 1 + strlen(typeName)) * sizeof(char*)));
@@ -165,7 +153,7 @@ int slot_init(PyObject *self, PyObject *args, PyObject *kw)
data->slotName = strdup(argName);
if (argResult)
- data->resultType = slot_get_type_name(argResult);
+ data->resultType = get_type_name(argResult);
else
data->resultType = strdup("void");