diff options
author | Renato Filho <renato.filho@openbossa.org> | 2010-07-05 18:08:25 -0300 |
---|---|---|
committer | Renato Filho <renato.filho@openbossa.org> | 2010-07-08 11:26:43 -0300 |
commit | 83db5730319cc258e683a12567ba9362dbd07d45 (patch) | |
tree | 5f252bfcc0d4620b37c950c2ac18b53337abbe7b /libpyside | |
parent | c737f90c1ddbe19cbbe93cb3915e14df59f97444 (diff) |
Use original name in type discovery during signal/slot.
Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org>,
Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'libpyside')
-rw-r--r-- | libpyside/qsignal.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp index aa211a720..b19c5658c 100644 --- a/libpyside/qsignal.cpp +++ b/libpyside/qsignal.cpp @@ -243,14 +243,20 @@ void signalUpdateSource(PyObject* source) char* signal_get_type_name(PyObject* type) { if (PyType_Check(type)) { - //tp_name return the full name - Shiboken::AutoDecRef typeName(PyObject_GetAttrString(type, "__name__")); - char *aux = strdup(PyString_AS_STRING(typeName.object())); - if (Shiboken::TypeResolver::getType(aux) == Shiboken::TypeResolver::ObjectType) { - aux = reinterpret_cast<char*>(realloc(aux, strlen(aux) + 1)); - aux = strcat(aux, "*"); + char *typeName = NULL; + if (type->ob_type == &Shiboken::SbkBaseWrapperType_Type) { + Shiboken::SbkBaseWrapperType *objType = reinterpret_cast<Shiboken::SbkBaseWrapperType*>(type); + typeName = strdup(objType->original_name); + } else { + //tp_name return the full name + Shiboken::AutoDecRef otypeName(PyObject_GetAttrString(type, "__name__")); + typeName = strdup(PyString_AS_STRING(otypeName.object())); } - return aux; + if (Shiboken::TypeResolver::getType(typeName) == Shiboken::TypeResolver::ObjectType) { + typeName = reinterpret_cast<char*>(realloc(typeName, strlen(typeName) + 1)); + typeName = strcat(typeName, "*"); + } + return typeName; } else if (PyString_Check(type)) { return strdup(PyString_AS_STRING(type)); } |