Updated PySide type systems to use the new type system variables: %ISCONVERTIBLE and %CHECKTYPE.
Reviewed by Luciano Wolf <luciano.wolf@openbossa.org> Reviewed by Renato Araujo <renato.filho@openbossa.org>
This commit is contained in:
parent
07229012b7
commit
2b1df1698c
2 changed files with 4 additions and 4 deletions
|
|
@ -2126,7 +2126,7 @@
|
||||||
Shiboken::AutoDecRef fileNo(PyObject_GetAttrString(%PYARG_1, "fileno"));
|
Shiboken::AutoDecRef fileNo(PyObject_GetAttrString(%PYARG_1, "fileno"));
|
||||||
if (!fileNo.isNull()) {
|
if (!fileNo.isNull()) {
|
||||||
Shiboken::AutoDecRef fileNoValue(PyObject_CallObject(fileNo, 0));
|
Shiboken::AutoDecRef fileNoValue(PyObject_CallObject(fileNo, 0));
|
||||||
if (Shiboken::Converter<int>::checkType(fileNoValue))
|
if (%CHECKTYPE[int](fileNoValue))
|
||||||
%0 = new %TYPE(%CONVERTTOCPP[int](fileNoValue), %2, %3);
|
%0 = new %TYPE(%CONVERTTOCPP[int](fileNoValue), %2, %3);
|
||||||
}
|
}
|
||||||
</inject-code>
|
</inject-code>
|
||||||
|
|
|
||||||
|
|
@ -2715,14 +2715,14 @@
|
||||||
int size = PySequence_Fast_GET_SIZE(seq.object());
|
int size = PySequence_Fast_GET_SIZE(seq.object());
|
||||||
|
|
||||||
if (size > 1) {
|
if (size > 1) {
|
||||||
if (Shiboken::Converter<QString>::isConvertible(PySequence_Fast_GET_ITEM(seq.object(), 1)))
|
if (%ISCONVERTIBLE[QString](PySequence_Fast_GET_ITEM(seq.object(), 1)))
|
||||||
%1 = %CONVERTTOCPP[QString](PySequence_Fast_GET_ITEM(seq.object(), 1));
|
%1 = %CONVERTTOCPP[QString](PySequence_Fast_GET_ITEM(seq.object(), 1));
|
||||||
else
|
else
|
||||||
qWarning("%TYPE::%FUNCTION_NAME: Second tuple element is not convertible to unicode.");
|
qWarning("%TYPE::%FUNCTION_NAME: Second tuple element is not convertible to unicode.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size > 2) {
|
if (size > 2) {
|
||||||
if (Shiboken::Converter<int>::isConvertible(PySequence_Fast_GET_ITEM(seq.object(), 2)))
|
if (%ISCONVERTIBLE[int](PySequence_Fast_GET_ITEM(seq.object(), 2)))
|
||||||
%2 = %CONVERTTOCPP[int](PySequence_Fast_GET_ITEM(seq.object(), 2));
|
%2 = %CONVERTTOCPP[int](PySequence_Fast_GET_ITEM(seq.object(), 2));
|
||||||
else
|
else
|
||||||
qWarning("%TYPE::%FUNCTION_NAME: Second tuple element is not convertible to int.");
|
qWarning("%TYPE::%FUNCTION_NAME: Second tuple element is not convertible to int.");
|
||||||
|
|
@ -2732,7 +2732,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// check retrun value
|
// check retrun value
|
||||||
if (Shiboken::Converter<QValidator::State>::isConvertible(%PYARG_0)) {
|
if (%ISCONVERTIBLE[QValidator::State](%PYARG_0)) {
|
||||||
%out = %CONVERTTOCPP[QValidator::State](%PYARG_0);
|
%out = %CONVERTTOCPP[QValidator::State](%PYARG_0);
|
||||||
} else {
|
} else {
|
||||||
PyErr_Format(PyExc_TypeError, "Invalid return value in function %s, expected %s, got %s.",
|
PyErr_Format(PyExc_TypeError, "Invalid return value in function %s, expected %s, got %s.",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue