summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-08-18 14:34:21 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2011-08-18 14:36:50 -0300
commitcaec3411765160add1e5ce2521a6da9f3e1b8d0c (patch)
treebcae7c60d17957be78ac5099f6cf35a912038009
parent660e5e29664d4e4a13cc27e57e29963624243f7a (diff)
downloadpyside-caec3411765160add1e5ce2521a6da9f3e1b8d0c.tar.gz
pyside-caec3411765160add1e5ce2521a6da9f3e1b8d0c.tar.xz
pyside-caec3411765160add1e5ce2521a6da9f3e1b8d0c.zip
Updated QtNetwork's type system.
-rw-r--r--PySide/QtNetwork/typesystem_network.xml38
1 files changed, 18 insertions, 20 deletions
diff --git a/PySide/QtNetwork/typesystem_network.xml b/PySide/QtNetwork/typesystem_network.xml
index 6acbdef..d4aa34e 100644
--- a/PySide/QtNetwork/typesystem_network.xml
+++ b/PySide/QtNetwork/typesystem_network.xml
@@ -233,17 +233,17 @@
return 16;
</inject-code>
</add-function>
- <add-function signature="__getitem__">
+ <add-function signature="__getitem__">
<inject-code class="target" position="beginning">
- if (_i >= 16) {
- PyErr_SetString(PyExc_IndexError, "index out of bounds");
- return 0;
- }
-
- if (_i &lt; 0)
- _i = 16 - qAbs(_i);
+ if (_i >= 16) {
+ PyErr_SetString(PyExc_IndexError, "index out of bounds");
+ return 0;
+ }
+ if (_i &lt; 0)
+ _i = 16 - qAbs(_i);
- return %CONVERTTOPYTHON[uint](%CPPSELF->c[_i]);
+ uint item = %CPPSELF.c[_i];
+ return %CONVERTTOPYTHON[uint](item);
</inject-code>
</add-function>
<add-function signature="__len__">
@@ -253,17 +253,15 @@
</add-function>
<add-function signature="__setitem__">
<inject-code class="target" position="beginning">
- if (_i >= 16) {
- PyErr_SetString(PyExc_IndexError, "index out of bounds");
- return -1;
- }
-
- if (_i &lt; 0)
- _i = 16 - qAbs(_i);
-
- %CPPSELF->c[_i] = %CONVERTTOCPP[quint8](_value);
-
- return 0;
+ if (_i >= 16) {
+ PyErr_SetString(PyExc_IndexError, "index out of bounds");
+ return -1;
+ }
+ if (_i &lt; 0)
+ _i = 16 - qAbs(_i);
+ quint8 item = %CONVERTTOCPP[quint8](_value);
+ %CPPSELF.c[_i] = item;
+ return 0;
</inject-code>
</add-function>
</value-type>