diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-11-10 17:22:32 -0200 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-11-10 17:22:32 -0200 |
commit | 92dcb7ae3a92416b4129d549625eba0512e02426 (patch) | |
tree | 37d070b8a62502ec8a055d70b7c9d5a7453e179e /PySide/QtCore/glue | |
parent | 66ff08586178ffb601fe874d48b9847fb577f513 (diff) |
Changes needed to compile QtCore with libshiboken v1.0
Diffstat (limited to 'PySide/QtCore/glue')
-rw-r--r-- | PySide/QtCore/glue/qbytearray_bufferprotocol.cpp | 2 | ||||
-rw-r--r-- | PySide/QtCore/glue/qcoreapplication_init.cpp | 21 | ||||
-rw-r--r-- | PySide/QtCore/glue/qobject_connect.cpp | 4 |
3 files changed, 14 insertions, 13 deletions
diff --git a/PySide/QtCore/glue/qbytearray_bufferprotocol.cpp b/PySide/QtCore/glue/qbytearray_bufferprotocol.cpp index 4fd158789..19ee4e7b6 100644 --- a/PySide/QtCore/glue/qbytearray_bufferprotocol.cpp +++ b/PySide/QtCore/glue/qbytearray_bufferprotocol.cpp @@ -15,7 +15,7 @@ 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::cppObjectIsInvalid(self)) + if (segment || !Shiboken::Wrapper::isValid(self)) return -1; QByteArray* cppSelf = Converter<QByteArray*>::toCpp(self); diff --git a/PySide/QtCore/glue/qcoreapplication_init.cpp b/PySide/QtCore/glue/qcoreapplication_init.cpp index 8ae53f341..274afb6d3 100644 --- a/PySide/QtCore/glue/qcoreapplication_init.cpp +++ b/PySide/QtCore/glue/qcoreapplication_init.cpp @@ -2,7 +2,7 @@ static int QCoreApplicationArgCount; static char** QCoreApplicationArgValues; -int SbkQCoreApplication_Init(PyObject* self, PyObject* args, PyObject*) +int Sbk_QCoreApplication_Init(PyObject* self, PyObject* args, PyObject*) { if (Shiboken::isUserType(self) && !Shiboken::canCallConstructor(self->ob_type, Shiboken::SbkType<QApplication >())) return -1; @@ -19,20 +19,21 @@ int SbkQCoreApplication_Init(PyObject* self, PyObject* args, PyObject*) return -1; } - if (!PySequenceToArgcArgv(PyTuple_GET_ITEM(args, 0), &QCoreApplicationArgCount, &QCoreApplicationArgValues, "PySideApp")) { + if (!Shiboken::sequenceToArgcArgv(PyTuple_GET_ITEM(args, 0), &QCoreApplicationArgCount, &QCoreApplicationArgValues, "PySideApp")) { PyErr_BadArgument(); return -1; } + SbkObject* sbkSelf = reinterpret_cast<SbkObject*>(self); QCoreApplicationWrapper* cptr = new QCoreApplicationWrapper(QCoreApplicationArgCount, QCoreApplicationArgValues); - Shiboken::setCppPointer(reinterpret_cast<SbkBaseWrapper*>(self), - Shiboken::SbkType<QCoreApplication>(), - cptr); - - SbkBaseWrapper_setValidCppObject(self, 1); - SbkBaseWrapper *sbkSelf = reinterpret_cast<SbkBaseWrapper*>(self); - sbkSelf->containsCppWrapper = 1; - sbkSelf->hasOwnership = 0; + Shiboken::Wrapper::setCppPointer(sbkSelf, + Shiboken::SbkType<QCoreApplication>(), + cptr); + + Shiboken::Wrapper::setValidCpp(sbkSelf, true); + Shiboken::Wrapper::setHasCppWrapper(sbkSelf, true); + Shiboken::Wrapper::releaseOwnership(sbkSelf); + Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr); PySide::Signal::updateSourceObject(self); cptr->metaObject(); diff --git a/PySide/QtCore/glue/qobject_connect.cpp b/PySide/QtCore/glue/qobject_connect.cpp index 770265557..dea4440a5 100644 --- a/PySide/QtCore/glue/qobject_connect.cpp +++ b/PySide/QtCore/glue/qobject_connect.cpp @@ -1,4 +1,4 @@ -static bool getReceiver(PyObject *callback, QObject **receiver, PyObject **self) +static bool getReceiver(PyObject* callback, QObject** receiver, PyObject** self) { if (PyMethod_Check(callback)) { *self = PyMethod_GET_SELF(callback); @@ -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 && !((SbkBaseWrapper*)self)->containsCppWrapper) { + if (!usingGlobalReceiver && self && !Shiboken::Wrapper::hasCppWrapper((SbkObject*)self)) { qWarning() << "You can't add dynamic slots on an object originated from C++."; return false; } |