aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-07-21 19:10:46 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:38 -0300
commitf10f4f70d4ffe21ace185db5da4ce4ab0fba9b34 (patch)
tree8d185688063daee05962492991e7982cff21a0ee
parent5902ca2e66913a374cbfde629b97807e4e2b4bc4 (diff)
Fix bug 938 - "QTemporaryFile JPEG problem"
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--PySide/QtCore/typesystem_core.xml5
-rw-r--r--tests/QtCore/CMakeLists.txt1
-rw-r--r--tests/QtCore/bug_938.py14
3 files changed, 20 insertions, 0 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 3a764c90d..ea1544d56 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1978,6 +1978,11 @@
<modify-function signature="readLine(char *,qint64)" remove="all"/>
<!-- ### write(str) do the job -->
<modify-function signature="write(const char *,qint64)" remove="all"/>
+ <modify-function signature="write(const char *)">
+ <inject-code>
+ %PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%CPPSELF.%FUNCTION_NAME(%1, PyString_GET_SIZE(%PYARG_1)));
+ </inject-code>
+ </modify-function>
<modify-function signature="getChar(char *)">
<modify-argument index="1">
<remove-argument />
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt
index 9ddb44c99..c5147e8c6 100644
--- a/tests/QtCore/CMakeLists.txt
+++ b/tests/QtCore/CMakeLists.txt
@@ -19,6 +19,7 @@ PYSIDE_TEST(bug_835.py)
PYSIDE_TEST(bug_920.py)
PYSIDE_TEST(bug_927.py)
PYSIDE_TEST(bug_931.py)
+PYSIDE_TEST(bug_938.py)
PYSIDE_TEST(blocking_signals_test.py)
PYSIDE_TEST(classinfo_test.py)
PYSIDE_TEST(child_event_test.py)
diff --git a/tests/QtCore/bug_938.py b/tests/QtCore/bug_938.py
new file mode 100644
index 000000000..b2ab5657c
--- /dev/null
+++ b/tests/QtCore/bug_938.py
@@ -0,0 +1,14 @@
+import unittest
+from PySide.QtCore import *
+
+class TestBug938 (unittest.TestCase):
+
+ def testIt(self):
+ b = QBuffer()
+ b.open(QBuffer.WriteOnly)
+ b.write("\x0023\x005")
+ b.close()
+ self.assertEqual(b.buffer().size(), 5)
+
+if __name__ == '__main__':
+ unittest.main()