Fixed code for QUdpSocket.readDatagram method to remove usage of Shiboken::makeTuple.
This commit is contained in:
parent
30118e265d
commit
7b04273736
2 changed files with 13 additions and 7 deletions
|
|
@ -1,6 +0,0 @@
|
||||||
Shiboken::AutoArrayPointer<char> data(%ARGUMENT_NAMES);
|
|
||||||
QHostAddress ha;
|
|
||||||
quint16 port;
|
|
||||||
|
|
||||||
%RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(data, %ARGUMENT_NAMES, &ha, &port);
|
|
||||||
%PYARG_0 = Shiboken::makeTuple(QByteArray(data, retval), ha, port);
|
|
||||||
|
|
@ -136,7 +136,19 @@
|
||||||
<modify-argument index="return">
|
<modify-argument index="return">
|
||||||
<replace-type modified-type="(data, address, port)"/>
|
<replace-type modified-type="(data, address, port)"/>
|
||||||
</modify-argument>
|
</modify-argument>
|
||||||
<inject-code class="target" position="beginning" file="glue/qudpsocket_read_datagram_glue.cpp"/>
|
<inject-code class="target" position="beginning">
|
||||||
|
Shiboken::AutoArrayPointer<char> data(%ARGUMENT_NAMES);
|
||||||
|
QHostAddress ha;
|
||||||
|
quint16 port;
|
||||||
|
%BEGIN_ALLOW_THREADS
|
||||||
|
%RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(data, %ARGUMENT_NAMES, &ha, &port);
|
||||||
|
%END_ALLOW_THREADS
|
||||||
|
QByteArray ba(data, retval);
|
||||||
|
PyObject* %PYARG_0 = PyTuple_New(3);
|
||||||
|
PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[QByteArray](ba));
|
||||||
|
PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QHostAddress](ha));
|
||||||
|
PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[quint16](port));
|
||||||
|
</inject-code>
|
||||||
</modify-function>
|
</modify-function>
|
||||||
<modify-function signature="writeDatagram(const QByteArray&, const QHostAddress&, quint16)" allow-thread="yes"/>
|
<modify-function signature="writeDatagram(const QByteArray&, const QHostAddress&, quint16)" allow-thread="yes"/>
|
||||||
<!-- ### writeDatagram(QByteArray, ...) does the trick -->
|
<!-- ### writeDatagram(QByteArray, ...) does the trick -->
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue