summaryrefslogtreecommitdiffstats
path: root/PySide
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-10-19 15:30:59 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2010-10-19 16:35:59 -0200
commit65022ffef62096033bcff49c4544640dac92f44e (patch)
tree3c18f989ea7aa8a972a316a07cac672f5899dfee /PySide
parente7f280f7451b3429fc1e1407225a6b9d27db1888 (diff)
downloadpyside-65022ffef62096033bcff49c4544640dac92f44e.tar.gz
pyside-65022ffef62096033bcff49c4544640dac92f44e.tar.xz
pyside-65022ffef62096033bcff49c4544640dac92f44e.zip
Fix bug#408 - "QIODevice.readData() and .readLineData() have output parameters in their signatures"
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'PySide')
-rw-r--r--PySide/QtCore/typesystem_core.xml40
1 files changed, 38 insertions, 2 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index a72abce..e9f5f31 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1767,8 +1767,6 @@
<modify-function signature="waitForBytesWritten(int)" allow-thread="yes"/>
<modify-function signature="peek(char *,qint64)" remove="all"/>
<modify-function signature="read(char *,qint64)" remove="all"/>
-<!-- Needed by QNetworkReply class on QtNetwork module -->
-<!-- <modify-function signature="readData(char *,qint64)" remove="all"/> -->
<modify-function signature="readLine(char *,qint64)" remove="all"/>
<modify-function signature="write(const char *,qint64)" remove="all"/>
<modify-function signature="getChar(char *)">
@@ -1780,6 +1778,44 @@
<insert-template name="fix_char*" />
</inject-code>
</modify-function>
+ <modify-function signature="readData(char *,qint64)">
+ <inject-code class="target">
+ QByteArray ba;
+ ba.resize(%2);
+ %CPPSELF.%FUNCTION_NAME(ba.data(), ba.size());
+ %PYARG_0 = %CONVERTTOPYTHON[QByteArray](ba);
+ </inject-code>
+ <modify-argument index="1">
+ <remove-argument />
+ </modify-argument>
+ <modify-argument index="return">
+ <replace-type modified-type="QByteArray"/>
+ <conversion-rule class="native">
+ const QByteArray ba(%CONVERTTOCPP[QByteArray](%PYARG_0));
+ memcpy(data, ba.data(), ba.size());
+ long long %out = ba.size();
+ </conversion-rule>
+ </modify-argument>
+ </modify-function>
+ <modify-function signature="readLineData(char *,qint64)">
+ <inject-code class="target">
+ QByteArray ba;
+ ba.resize(%2);
+ %CPPSELF.%FUNCTION_NAME(ba.data(), ba.size());
+ %PYARG_0 = %CONVERTTOPYTHON[QByteArray](ba);
+ </inject-code>
+ <modify-argument index="1">
+ <remove-argument />
+ </modify-argument>
+ <modify-argument index="return">
+ <replace-type modified-type="QByteArray"/>
+ <conversion-rule class="native">
+ const QByteArray ba(%CONVERTTOCPP[QByteArray](%PYARG_0));
+ memcpy(data, ba.data(), ba.size());
+ long long %out = ba.size();
+ </conversion-rule>
+ </modify-argument>
+ </modify-function>
</object-type>
<object-type name="QCryptographicHash">
<enum-type name="Algorithm"/>