summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-11-30 17:47:35 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2011-12-09 19:25:36 -0300
commit55ac5ba259680881e46a6e35bd7453b5d9f0df5d (patch)
tree655878e83e03c58ee4cd25a592ae243fc235fe68
parente7d76b1765e93c6bd4b5830f92d06b328e5f70a3 (diff)
downloadpyside-55ac5ba259680881e46a6e35bd7453b5d9f0df5d.tar.gz
pyside-55ac5ba259680881e46a6e35bd7453b5d9f0df5d.tar.xz
pyside-55ac5ba259680881e46a6e35bd7453b5d9f0df5d.zip
Fixed code for QUdpSocket.readDatagram method to remove usage of Shiboken::makeTuple.
-rw-r--r--PySide/QtNetwork/glue/qudpsocket_read_datagram_glue.cpp6
-rw-r--r--PySide/QtNetwork/typesystem_network.xml14
2 files changed, 13 insertions, 7 deletions
diff --git a/PySide/QtNetwork/glue/qudpsocket_read_datagram_glue.cpp b/PySide/QtNetwork/glue/qudpsocket_read_datagram_glue.cpp
deleted file mode 100644
index bffc042..0000000
--- a/PySide/QtNetwork/glue/qudpsocket_read_datagram_glue.cpp
+++ /dev/null
@@ -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);
diff --git a/PySide/QtNetwork/typesystem_network.xml b/PySide/QtNetwork/typesystem_network.xml
index 250129b..87cb7d9 100644
--- a/PySide/QtNetwork/typesystem_network.xml
+++ b/PySide/QtNetwork/typesystem_network.xml
@@ -136,7 +136,19 @@
<modify-argument index="return">
<replace-type modified-type="(data, address, port)"/>
</modify-argument>
- <inject-code class="target" position="beginning" file="glue/qudpsocket_read_datagram_glue.cpp"/>
+ <inject-code class="target" position="beginning">
+ Shiboken::AutoArrayPointer&lt;char&gt; data(%ARGUMENT_NAMES);
+ QHostAddress ha;
+ quint16 port;
+ %BEGIN_ALLOW_THREADS
+ %RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(data, %ARGUMENT_NAMES, &amp;ha, &amp;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 signature="writeDatagram(const QByteArray&amp;, const QHostAddress&amp;, quint16)" allow-thread="yes"/>
<!-- ### writeDatagram(QByteArray, ...) does the trick -->