summaryrefslogtreecommitdiffstats
path: root/PySide
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-05-31 12:29:52 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2011-06-02 17:11:28 -0300
commit046bccece9b01656489f1f83bf55a575bb461239 (patch)
treecaeb07e37424904d63eff23a78c4ad007a9b87e0 /PySide
parentbec5ca48fd72f17c7bb5b3e43eb78edada67123b (diff)
downloadpyside-046bccece9b01656489f1f83bf55a575bb461239.tar.gz
pyside-046bccece9b01656489f1f83bf55a575bb461239.tar.xz
pyside-046bccece9b01656489f1f83bf55a575bb461239.zip
Moved internalPointer methods code injection into a code template.
Diffstat (limited to 'PySide')
-rw-r--r--PySide/QtCore/typesystem_core.xml10
-rw-r--r--PySide/typesystem_templates.xml6
2 files changed, 8 insertions, 8 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 1032b58..5bb6922 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -993,10 +993,7 @@
<value-type name="QPersistentModelIndex">
<modify-function signature="internalPointer()const">
<inject-code class="target" position="beginning">
- %PYARG_0 = (PyObject*)%CPPSELF.%FUNCTION_NAME();
- if (!%PYARG_0)
- %PYARG_0 = Py_None;
- Py_XINCREF(%PYARG_0);
+ <insert-template name="return_internal_pointer" />
</inject-code>
</modify-function>
<modify-function signature="operator const QModelIndex&amp;()const">
@@ -2833,10 +2830,7 @@
<value-type name="QModelIndex">
<modify-function signature="internalPointer()const">
<inject-code class="target" position="beginning">
- %PYARG_0 = (PyObject*)%CPPSELF.%FUNCTION_NAME();
- if (!%PYARG_0)
- %PYARG_0 = Py_None;
- Py_XINCREF(%PYARG_0);
+ <insert-template name="return_internal_pointer" />
</inject-code>
</modify-function>
<modify-function signature="model()const">
diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml
index 8a26281..3a46c62 100644
--- a/PySide/typesystem_templates.xml
+++ b/PySide/typesystem_templates.xml
@@ -272,6 +272,12 @@
%PYARG_0 = PyString_FromString(qPrintable(format));
</template>
+ <template name="return_internal_pointer">
+ %PYARG_0 = reinterpret_cast&lt;PyObject*>(%CPPSELF.%FUNCTION_NAME());
+ if (!%PYARG_0)
+ %PYARG_0 = Py_None;
+ Py_INCREF(%PYARG_0);
+ </template>
<!-- templates for __reduce__ -->
<template name="reduce_code">