diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-02-24 15:19:36 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-02-24 15:41:05 -0300 |
commit | eeb50b166bc122cf5326e842528d92b4e0914ff3 (patch) | |
tree | 797549e264741ef8608f9ccdea3f262ea43eea96 | |
parent | 15cfd5f5a2da879f0ac4a1f5dfd4f2fb139ac6b4 (diff) |
Custom code should use Converters instead of the "_cptr" macros.
Reviewed by Hugo Parente <hugo.lima@openbossa.org>
-rw-r--r-- | PySide/QtCore/glue/qbytearray_bufferprotocol.cpp | 2 | ||||
-rw-r--r-- | PySide/QtCore/glue/qobject_connect.cpp | 4 | ||||
-rw-r--r-- | PySide/QtCore/glue/qstring_bufferprotocol.cpp | 2 | ||||
-rw-r--r-- | PySide/QtCore/qchar_conversions.h | 2 | ||||
-rw-r--r-- | PySide/QtCore/qstring_conversions.h | 2 | ||||
-rw-r--r-- | PySide/QtCore/qvariant_conversions.h | 2 | ||||
-rw-r--r-- | PySide/QtCore/typesystem_core.xml | 4 | ||||
-rw-r--r-- | PySide/QtGui/qpixmap_conversion.h | 2 |
8 files changed, 10 insertions, 10 deletions
diff --git a/PySide/QtCore/glue/qbytearray_bufferprotocol.cpp b/PySide/QtCore/glue/qbytearray_bufferprotocol.cpp index f0d15048e..4fd158789 100644 --- a/PySide/QtCore/glue/qbytearray_bufferprotocol.cpp +++ b/PySide/QtCore/glue/qbytearray_bufferprotocol.cpp @@ -18,7 +18,7 @@ static Py_ssize_t SbkQByteArray_readbufferproc(PyObject* self, Py_ssize_t segmen if (segment || Shiboken::cppObjectIsInvalid(self)) return -1; - QByteArray* cppSelf = SbkQByteArray_cptr(self); + QByteArray* cppSelf = Converter<QByteArray*>::toCpp(self); *ptrptr = reinterpret_cast<void*>(cppSelf->data()); return cppSelf->size(); } diff --git a/PySide/QtCore/glue/qobject_connect.cpp b/PySide/QtCore/glue/qobject_connect.cpp index 1b28ee0a8..b813be9a6 100644 --- a/PySide/QtCore/glue/qobject_connect.cpp +++ b/PySide/QtCore/glue/qobject_connect.cpp @@ -3,11 +3,11 @@ static bool getReceiver(PyObject *callback, QObject **receiver, PyObject **self) if (PyMethod_Check(callback)) { *self = PyMethod_GET_SELF(callback); if (SbkQObject_Check(*self)) - *receiver = SbkQObject_cptr(*self); + *receiver = Converter<QObject*>::toCpp(*self); } else if (PyCFunction_Check(callback)) { *self = PyCFunction_GET_SELF(callback); if (*self && SbkQObject_Check(*self)) - *receiver = SbkQObject_cptr(*self); + *receiver = Converter<QObject*>::toCpp(*self); } else if (!PyFunction_Check(callback)) { *receiver = 0; *self = 0; diff --git a/PySide/QtCore/glue/qstring_bufferprotocol.cpp b/PySide/QtCore/glue/qstring_bufferprotocol.cpp index 9e7fb2cf1..02ca32c6f 100644 --- a/PySide/QtCore/glue/qstring_bufferprotocol.cpp +++ b/PySide/QtCore/glue/qstring_bufferprotocol.cpp @@ -18,7 +18,7 @@ static Py_ssize_t SbkQString_readbufferproc(PyObject* self, Py_ssize_t segment, if (segment || Shiboken::cppObjectIsInvalid(self)) return -1; - QString* cppSelf = SbkQString_cptr(self); + QString* cppSelf = Converter<QString*>::toCpp(self); QByteArray decodedData = cppSelf->toLocal8Bit(); Shiboken::AutoDecRef decodedString(PyString_FromStringAndSize(decodedData.constData(), decodedData.size())); diff --git a/PySide/QtCore/qchar_conversions.h b/PySide/QtCore/qchar_conversions.h index 2429926d1..345befade 100644 --- a/PySide/QtCore/qchar_conversions.h +++ b/PySide/QtCore/qchar_conversions.h @@ -20,6 +20,6 @@ inline QChar Shiboken::Converter<QChar >::toCpp(PyObject* pyobj) else if (PyInt_Check(pyobj)) return QChar(Shiboken::Converter<int >::toCpp(pyobj)); } - return *SbkQChar_cptr(pyobj); + return *Converter<QChar*>::toCpp(pyobj); } } diff --git a/PySide/QtCore/qstring_conversions.h b/PySide/QtCore/qstring_conversions.h index e0b8ce09e..9a33d08d7 100644 --- a/PySide/QtCore/qstring_conversions.h +++ b/PySide/QtCore/qstring_conversions.h @@ -50,6 +50,6 @@ inline QString Converter< QString >::toCpp(PyObject* pyobj) return QString(data); } #endif - return *SbkQString_cptr(pyobj); + return *Converter<QString*>::toCpp(pyobj); } } diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h index d71516203..f3a7dfa80 100644 --- a/PySide/QtCore/qvariant_conversions.h +++ b/PySide/QtCore/qvariant_conversions.h @@ -39,7 +39,7 @@ inline bool Converter<QVariant>::isConvertible(PyObject* pyobj) inline QVariant Converter<QVariant>::toCpp(PyObject* pyobj) { if (SbkQVariant_Check(pyobj)) - return *SbkQVariant_cptr(pyobj); + return *Converter<QVariant*>::toCpp(pyobj); // voodoo stuff to avoid linking qtcore bindings with qtgui bindings uint typeCode = QMetaType::type(pyobj->ob_type->tp_name); if (!typeCode || typeCode > QVariant::UserType) { diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml index 7f98a107b..cbf94addd 100644 --- a/PySide/QtCore/typesystem_core.xml +++ b/PySide/QtCore/typesystem_core.xml @@ -2336,7 +2336,7 @@ PyObject* pyTimer = Shiboken::SbkType<QTimer>()->tp_new(Shiboken::SbkType<QTimer>(), emptyTuple, 0); Shiboken::SbkType<QTimer>()->tp_init(pyTimer, emptyTuple, 0); - QTimer* timer = SbkQTimer_cptr(pyTimer); + QTimer* timer = Converter<QTimer*>::toCpp(pyTimer); PyObject* result = PyObject_CallMethod(pyTimer, "connect", "OsOs", pyTimer, SIGNAL(timeout()), %PYARG_2, %3); Py_DECREF(result); timer->setSingleShot(true); @@ -2350,7 +2350,7 @@ Shiboken::AutoDecRef emptyTuple(PyTuple_New(0)); PyObject* pyTimer = Shiboken::SbkType<QTimer>()->tp_new(Shiboken::SbkType<QTimer>(), emptyTuple, 0); Shiboken::SbkType<QTimer>()->tp_init(pyTimer, emptyTuple, 0); - QTimer* timer = SbkQTimer_cptr(pyTimer); + QTimer* timer = Converter<QTimer*>::toCpp(pyTimer); timer->setSingleShot(true); timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater())); PyObject* result = PyObject_CallMethod(pyTimer, "connect", "OsO", pyTimer, SIGNAL(timeout()), pyargs[2-1]); diff --git a/PySide/QtGui/qpixmap_conversion.h b/PySide/QtGui/qpixmap_conversion.h index 411592dd2..cad242b95 100644 --- a/PySide/QtGui/qpixmap_conversion.h +++ b/PySide/QtGui/qpixmap_conversion.h @@ -24,6 +24,6 @@ inline QPixmap Converter< QPixmap >::toCpp(PyObject* pyobj) return QPixmap(Shiboken::Converter<QString& >::toCpp(pyobj)); } - return *SbkQPixmap_cptr(pyobj); + return *Converter<QPixmap*>::toCpp(pyobj); } } |