diff options
author | Renato Araujo Oliveira Filho <renato.filho@openbossa.org> | 2011-01-04 18:32:24 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:48:07 -0300 |
commit | f7fd9277f47359f8eb4490bcb8f5bdc84000035e (patch) | |
tree | 2d1e184a67de6463b79f67b54b2a119234bc4aae /PySide | |
parent | 4351b2e5133e89c02ff26ecbf0f7df6e902efc64 (diff) |
Fixed function QDataStream.readRawData return value.
The function readRawData now return None in case of error, otherwise a
string with the read data.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'PySide')
-rw-r--r-- | PySide/QtCore/typesystem_core.xml | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml index df04ca9c8..54513f951 100644 --- a/PySide/QtCore/typesystem_core.xml +++ b/PySide/QtCore/typesystem_core.xml @@ -2388,8 +2388,13 @@ <inject-code class="target"> QByteArray data; data.resize(%2); - %CPPSELF.%FUNCTION_NAME(data.data(), data.size()); - %PYARG_0 = PyString_FromStringAndSize(data.constData(), data.size()); + int result = %CPPSELF.%FUNCTION_NAME(data.data(), data.size()); + if (result == -1) { + Py_INCREF(Py_None); + %PYARG_0 = Py_None; + } else { + %PYARG_0 = PyString_FromStringAndSize(data.data(), result); + } </inject-code> </modify-function> <!-- deprecated method --> |