Adapt to API changes in libshiboken.

This commit is contained in:
Hugo Parente Lima 2010-11-23 14:37:16 -02:00
commit a8ae0680f2
21 changed files with 92 additions and 92 deletions

View file

@ -15,10 +15,10 @@ static Py_ssize_t SbkQByteArray_segcountproc(PyObject* self, Py_ssize_t* lenp)
static Py_ssize_t SbkQByteArray_readbufferproc(PyObject* self, Py_ssize_t segment, void** ptrptr)
{
if (segment || !Shiboken::Wrapper::isValid(self))
if (segment || !Shiboken::Object::isValid(self))
return -1;
QByteArray* cppSelf = Converter<QByteArray*>::toCpp(self);
QByteArray* cppSelf = Shiboken::Converter<QByteArray*>::toCpp(self);
*ptrptr = reinterpret_cast<void*>(cppSelf->data());
return cppSelf->size();
}

View file

@ -4,7 +4,7 @@ static char** QCoreApplicationArgValues;
int Sbk_QCoreApplication_Init(PyObject* self, PyObject* args, PyObject*)
{
if (Shiboken::Wrapper::isUserType(self) && !Shiboken::BaseType::canCallConstructor(self->ob_type, Shiboken::SbkType<QApplication >()))
if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType<QApplication >()))
return -1;
@ -26,13 +26,13 @@ int Sbk_QCoreApplication_Init(PyObject* self, PyObject* args, PyObject*)
SbkObject* sbkSelf = reinterpret_cast<SbkObject*>(self);
QCoreApplicationWrapper* cptr = new QCoreApplicationWrapper(QCoreApplicationArgCount, QCoreApplicationArgValues);
Shiboken::Wrapper::setCppPointer(sbkSelf,
Shiboken::Object::setCppPointer(sbkSelf,
Shiboken::SbkType<QCoreApplication>(),
cptr);
Shiboken::Wrapper::setValidCpp(sbkSelf, true);
Shiboken::Wrapper::setHasCppWrapper(sbkSelf, true);
Shiboken::Wrapper::releaseOwnership(sbkSelf);
Shiboken::Object::setValidCpp(sbkSelf, true);
Shiboken::Object::setHasCppWrapper(sbkSelf, true);
Shiboken::Object::releaseOwnership(sbkSelf);
Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr);
PySide::Signal::updateSourceObject(self);

View file

@ -3,11 +3,11 @@ static bool getReceiver(PyObject* callback, QObject** receiver, PyObject** self)
if (PyMethod_Check(callback)) {
*self = PyMethod_GET_SELF(callback);
if (Shiboken::Converter<QObject*>::checkType(*self))
*receiver = Converter<QObject*>::toCpp(*self);
*receiver = Shiboken::Converter<QObject*>::toCpp(*self);
} else if (PyCFunction_Check(callback)) {
*self = PyCFunction_GET_SELF(callback);
if (*self && Shiboken::Converter<QObject*>::checkType(*self))
*receiver = Converter<QObject*>::toCpp(*self);
*receiver = Shiboken::Converter<QObject*>::toCpp(*self);
} else if (PyCallable_Check(callback)) {
// Ok, just a callable object
*receiver = 0;
@ -66,7 +66,7 @@ static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject
const char* slot = callbackSig.constData();
int slotIndex = metaObject->indexOfSlot(slot);
if (slotIndex == -1) {
if (!usingGlobalReceiver && self && !Shiboken::Wrapper::hasCppWrapper((SbkObject*)self)) {
if (!usingGlobalReceiver && self && !Shiboken::Object::hasCppWrapper((SbkObject*)self)) {
qWarning() << "You can't add dynamic slots on an object originated from C++.";
return false;
}