diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2011-04-12 15:53:56 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:54:09 -0300 |
commit | c2c04ddd5107f0743441c9cf77c481254d168aae (patch) | |
tree | 0209a3ee7f8661976d2eca53cd6feb3d3bb50385 /PySide/QtCore | |
parent | b1ab2a02604bca8abfb18a2f626643a52c5d4453 (diff) |
Fix bug 723 - "Missing QAbstractFileEngine.read and QAbstractFileEngine.readLine"
Diffstat (limited to 'PySide/QtCore')
-rw-r--r-- | PySide/QtCore/typesystem_core.xml | 58 |
1 files changed, 53 insertions, 5 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml index eb3c45e15..cdaf97cbc 100644 --- a/PySide/QtCore/typesystem_core.xml +++ b/PySide/QtCore/typesystem_core.xml @@ -2070,7 +2070,13 @@ </inject-code> </add-function> </object-type> - <object-type name="QAbstractFileEngineHandler" /> + <object-type name="QAbstractFileEngineHandler"> + <modify-function signature="create(const QString↦)const"> + <modify-argument index="return"> + <define-ownership owner="c++"/> + </modify-argument> + </modify-function> + </object-type> <!-- <object-type name="QAbstractFileEngine::MapExtensionOption" /> --> <!-- <object-type name="QAbstractFileEngine::MapExtensionReturn" /> --> <!-- <object-type name="QAbstractFileEngine::UnMapExtensionOption" /> --> @@ -2113,10 +2119,52 @@ </inject-code> </modify-function> - <!-- ### See bug 723 --> - <modify-function signature="read(char*, qint64)" allow-thread="yes" remove="all" /> - <modify-function signature="readLine(char*, qint64)" allow-thread="yes" remove="all" /> - <!-- ### --> + <modify-function signature="read(char*, qint64)" allow-thread="yes"> + <inject-code class="target"> + QByteArray ba; + ba.resize(%2); + %CPPSELF.%FUNCTION_NAME(ba.data(), ba.size()); + %PYARG_0 = PyString_FromStringAndSize(ba.constData(), ba.size()); + </inject-code> + <modify-argument index="1"> + <remove-argument /> + </modify-argument> + <modify-argument index="return"> + <replace-type modified-type="PyObject"/> + <conversion-rule class="native"> + %RETURN_TYPE %out; + if (!PyString_Check(%PYARG_0)) { + %out = -1; + } else { + %out = PyString_GET_SIZE((PyObject*)%PYARG_0); + qstrncpy(%1, PyString_AS_STRING((PyObject*)%PYARG_0), %out + 1); + } + </conversion-rule> + </modify-argument> + </modify-function> + <modify-function signature="readLine(char*, qint64)" allow-thread="yes"> + <inject-code class="target"> + QByteArray ba; + ba.resize(%2); + %CPPSELF.%FUNCTION_NAME(ba.data(), ba.size()); + %PYARG_0 = PyString_FromStringAndSize(ba.constData(), ba.size()); + </inject-code> + <modify-argument index="1"> + <remove-argument /> + </modify-argument> + <modify-argument index="return"> + <replace-type modified-type="PyObject"/> + <conversion-rule class="native"> + %RETURN_TYPE %out; + if (!PyString_Check(%PYARG_0)) { + %out = -1; + } else { + %out = PyString_GET_SIZE((PyObject*)%PYARG_0); + qstrncpy(%1, PyString_AS_STRING((PyObject*)%PYARG_0), %out + 1); + } + </conversion-rule> + </modify-argument> + </modify-function> </object-type> <object-type name="QProcess"> <enum-type name="ExitStatus"/> |