aboutsummaryrefslogtreecommitdiffstats
path: root/PySide
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-04-06 18:35:49 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:08 -0300
commit6ef7460a47674072b2dd2f8521bea8c84f7153d5 (patch)
treeb7abb2be3d19f92f619f0f6c92b3da130ecc6c6b /PySide
parent0cb14ebf352b4174be9e60f47574aee432e35a1d (diff)
Fix bug 721 - "QFile doesn't support map and unmap functions."
Diffstat (limited to 'PySide')
-rw-r--r--PySide/QtCore/typesystem_core.xml21
1 files changed, 16 insertions, 5 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index d11d196fe..4a7456bd3 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1782,11 +1782,22 @@
<extra-includes>
<include file-name="QAbstractFileEngine" location="global"/>
</extra-includes>
- <!-- ### See bug 721 -->
- <modify-function signature="unmap(uchar*)" remove="all"/>
- <modify-function signature="map(qint64,qint64,QFile::MemoryMapFlags)" remove="all"/>
- <!-- ### -->
-
+ <modify-function signature="unmap(uchar*)">
+ <modify-argument index="1">
+ <replace-type modified-type="PyBuffer"/>
+ </modify-argument>
+ <inject-code>
+ const void* ptr;
+ Py_ssize_t len;
+ PyObject_AsReadBuffer(%PYARG_1, &amp;ptr, &amp;len);
+ %PYARG_0 = %CONVERTTOPYTHON[bool](%CPPSELF.%FUNCTION_NAME((uchar*)ptr));
+ </inject-code>
+ </modify-function>
+ <modify-function signature="map(qint64,qint64,QFile::MemoryMapFlags)">
+ <inject-code>
+ %PYARG_0 = PyBuffer_FromReadWriteMemory(%CPPSELF.%FUNCTION_NAME(%1, %2, %3), %2);
+ </inject-code>
+ </modify-function>
<modify-function signature="remove()" allow-thread="yes"/>
<modify-function signature="remove(const QString&amp;)" allow-thread="yes"/>
<modify-function signature="rename(const QString&amp;)" allow-thread="yes"/>