Merge branch 'apichanges'

Reviewer: Renato Araújo <renato.filho@openbossa.org>
          Luciano Wolf <luciano.wolf@openbossa.org>

Conflicts:
	libpyside/pyside.cpp
This commit is contained in:
Hugo Parente Lima 2010-11-23 15:04:27 -02:00
commit f31d910755
21 changed files with 92 additions and 92 deletions

View file

@ -119,14 +119,14 @@ void destroyQCoreApplication()
//filter only QObjects which we have ownership, this will avoid list changes during the destruction of some parent object
foreach (SbkObject* pyObj, bm.getAllPyObjects()) {
if (pyObj != pyQApp && PyObject_TypeCheck(pyObj, pyQObjectType)) {
if (Shiboken::Wrapper::hasOwnership(pyObj))
if (Shiboken::Object::hasOwnership(pyObj))
objects << pyObj;
}
}
//Now we can destroy all object in the list
foreach (SbkObject* pyObj, objects)
Shiboken::callCppDestructor<QObject>(Shiboken::Wrapper::cppPointer(pyObj, Shiboken::SbkType<QObject*>()));
Shiboken::callCppDestructor<QObject>(Shiboken::Object::cppPointer(pyObj, Shiboken::SbkType<QObject*>()));
// in the end destroy app
delete app;

View file

@ -40,7 +40,7 @@ struct QtDictConverter
if (PyObject_TypeCheck(pyObj, Shiboken::SbkType<QtDict>()))
return true;
if ((Shiboken::SbkType<QtDict>() && Shiboken::Wrapper::checkType(pyObj)) || !PyDict_Check(pyObj))
if ((Shiboken::SbkType<QtDict>() && Shiboken::Object::checkType(pyObj)) || !PyDict_Check(pyObj))
return false;
PyObject* key;
@ -73,7 +73,7 @@ struct QtDictConverter
static inline QtDict toCpp(PyObject* pyobj)
{
if (PyObject_TypeCheck(pyobj, Shiboken::SbkType<QtDict>()))
return *reinterpret_cast<QtDict*>(Shiboken::Wrapper::cppPointer((SbkObject*)pyobj, Shiboken::SbkType<QtDict>()));
return *reinterpret_cast<QtDict*>(Shiboken::Object::cppPointer((SbkObject*)pyobj, Shiboken::SbkType<QtDict>()));
QtDict result;
@ -100,7 +100,7 @@ struct QtMultiMapConverter
if (PyObject_TypeCheck(pyObj, Shiboken::SbkType<MultiMap>()))
return true;
if ((Shiboken::SbkType<MultiMap>() && Shiboken::Wrapper::checkType(pyObj)) || !PyDict_Check(pyObj))
if ((Shiboken::SbkType<MultiMap>() && Shiboken::Object::checkType(pyObj)) || !PyDict_Check(pyObj))
return false;
PyObject* key;
@ -150,7 +150,7 @@ struct QtMultiMapConverter
static inline MultiMap toCpp(PyObject* pyObj)
{
if (PyObject_TypeCheck(pyObj, Shiboken::SbkType<MultiMap>()))
return *reinterpret_cast<MultiMap*>(Shiboken::Wrapper::cppPointer((SbkObject*)pyObj, Shiboken::SbkType<MultiMap>()));
return *reinterpret_cast<MultiMap*>(Shiboken::Object::cppPointer((SbkObject*)pyObj, Shiboken::SbkType<MultiMap>()));
MultiMap result;
@ -176,7 +176,7 @@ struct QSequenceConverter
{
if (PyObject_TypeCheck(pyObj, Shiboken::SbkType<T>()))
return true;
if ((Shiboken::SbkType<T>() && Shiboken::Wrapper::checkType(pyObj)) || !PySequence_Check(pyObj))
if ((Shiboken::SbkType<T>() && Shiboken::Object::checkType(pyObj)) || !PySequence_Check(pyObj))
return false;
for (int i = 0, max = PySequence_Length(pyObj); i < max; ++i) {
Shiboken::AutoDecRef item(PySequence_GetItem(pyObj, i));
@ -199,7 +199,7 @@ struct QSequenceConverter
static T toCpp(PyObject* pyobj)
{
if (PyObject_TypeCheck(pyobj, Shiboken::SbkType<T>()))
return *reinterpret_cast<T*>(Shiboken::Wrapper::cppPointer((SbkObject*)pyobj, Shiboken::SbkType<T>()));
return *reinterpret_cast<T*>(Shiboken::Object::cppPointer((SbkObject*)pyobj, Shiboken::SbkType<T>()));
Shiboken::AutoDecRef fastSequence(PySequence_Fast(pyobj, "Invalid sequence object"));
T result;

View file

@ -493,9 +493,9 @@ char* getTypeName(PyObject* type)
{
if (PyType_Check(type)) {
char *typeName = NULL;
if (type->ob_type == &SbkBaseType_Type) {
SbkBaseType* objType = reinterpret_cast<SbkBaseType*>(type);
typeName = strdup(Shiboken::BaseType::getOriginalName(objType));
if (type->ob_type == &SbkObjectType_Type) {
SbkObjectType* objType = reinterpret_cast<SbkObjectType*>(type);
typeName = strdup(Shiboken::ObjectType::getOriginalName(objType));
} else {
// Translate python types to Qt names
PyTypeObject *objType = reinterpret_cast<PyTypeObject*>(type);
@ -669,7 +669,7 @@ PyObject* buildQtCompatible(const char* signature)
return ret;
}
void addSignalToWrapper(SbkBaseType* wrapperType, const char* signalName, PySideSignal* signal)
void addSignalToWrapper(SbkObjectType* wrapperType, const char* signalName, PySideSignal* signal)
{
PyObject* typeDict = wrapperType->super.ht_type.tp_dict;
PyObject* homonymousMethod;

View file

@ -107,7 +107,7 @@ PYSIDE_API void updateSourceObject(PyObject* source);
* @param self The Signal object
* @return Return the signal signature
**/
PYSIDE_API void addSignalToWrapper(SbkBaseType* wrapperType, const char* signalName, PySideSignal* signal);
PYSIDE_API void addSignalToWrapper(SbkObjectType* wrapperType, const char* signalName, PySideSignal* signal);
/**
* This function verify if the signature is a QtSignal base on SIGNAL flag

View file

@ -379,7 +379,7 @@ bool SignalManager::registerMetaMethod(QObject* source, const char* signature, Q
// Create the dynamic signal is needed
if (methodIndex == -1) {
SbkObject* self = Shiboken::BindingManager::instance().retrieveWrapper(source);
if (!Shiboken::Wrapper::hasCppWrapper(self)) {
if (!Shiboken::Object::hasCppWrapper(self)) {
qWarning() << "Invalid Signal signature:" << signature;
return false;
} else {