summaryrefslogtreecommitdiffstats
path: root/PySide
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2010-10-13 15:46:07 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2010-10-13 15:49:05 -0300
commit0568190e8b39e52660efed55004a5da2a2535944 (patch)
treed4afa44b6a25cbb88288f4eefff262c06fb5373b /PySide
parent7fab5c03a94a24f6496ad129485244f7d6f4f994 (diff)
downloadpyside-0568190e8b39e52660efed55004a5da2a2535944.tar.gz
pyside-0568190e8b39e52660efed55004a5da2a2535944.tar.xz
pyside-0568190e8b39e52660efed55004a5da2a2535944.zip
Adjusted QTimer.singleShot custom code since all Signals are callable now.
Reviewed by Luciano Wolf <luciano.wolf@openbossa.org> Reviewed by Renato Ara├║jo <renato.filho@openbossa.org>
Diffstat (limited to 'PySide')
-rw-r--r--PySide/QtCore/typesystem_core.xml58
1 files changed, 22 insertions, 36 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index d6fe524..9d36c3f 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1778,42 +1778,28 @@
timer->setSingleShot(true);
timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()));
- Shiboken::AutoDecRef result(
- PyObject_CallMethod(pyTimer,
- const_cast&lt;char*>("connect"),
- const_cast&lt;char*>("OsO"),
- pyTimer,
- SIGNAL(timeout()),
- pyargs[1])
- );
- Shiboken::BindingManager::instance().destroyWrapper((Shiboken::SbkBaseWrapper *)pyTimer);
- timer->start(%1);
- </inject-code>
- </add-function>
- <!-- Second argument is a PySide.QtCore.Signal. See bug #362. -->
- <add-function signature="singleShot(int, PyObject*)" static="yes">
- <inject-code class="target" position="beginning">
- if (!PyObject_TypeCheck(%2, &amp;PySideSignalInstanceType))
- goto Sbk%TYPEFunc_%FUNCTION_NAME_TypeError;
-
- // %FUNCTION_NAME() - disable generation of c++ function call
- Shiboken::AutoDecRef emptyTuple(PyTuple_New(0));
- PyObject* pyTimer = Shiboken::SbkType&lt;QTimer>()->tp_new(Shiboken::SbkType&lt;QTimer>(), emptyTuple, 0);
- Shiboken::SbkType&lt;QTimer>()->tp_init(pyTimer, emptyTuple, 0);
- QTimer* timer = Converter&lt;QTimer*>::toCpp(pyTimer);
- timer->setSingleShot(true);
- timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()));
- PySideSignalInstanceData* signalInstance = reinterpret_cast&lt;PySideSignalInstanceData*&gt;(%2);
- Shiboken::AutoDecRef signalSignature(PyString_FromFormat("2%s", signalInstance->signature));
- Shiboken::AutoDecRef result(
- PyObject_CallMethod(pyTimer,
- const_cast&lt;char*>("connect"),
- const_cast&lt;char*>("OsOO"),
- pyTimer,
- SIGNAL(timeout()),
- signalInstance->source,
- signalSignature.object())
- );
+ if (PyObject_TypeCheck(%2, &amp;PySideSignalInstanceType)) {
+ PySideSignalInstanceData* signalInstance = reinterpret_cast&lt;PySideSignalInstanceData*&gt;(%2);
+ Shiboken::AutoDecRef signalSignature(PyString_FromFormat("2%s", signalInstance->signature));
+ Shiboken::AutoDecRef result(
+ PyObject_CallMethod(pyTimer,
+ const_cast&lt;char*>("connect"),
+ const_cast&lt;char*>("OsOO"),
+ pyTimer,
+ SIGNAL(timeout()),
+ signalInstance->source,
+ signalSignature.object())
+ );
+ } else {
+ Shiboken::AutoDecRef result(
+ PyObject_CallMethod(pyTimer,
+ const_cast&lt;char*>("connect"),
+ const_cast&lt;char*>("OsO"),
+ pyTimer,
+ SIGNAL(timeout()),
+ pyargs[1])
+ );
+ }
Shiboken::BindingManager::instance().destroyWrapper((Shiboken::SbkBaseWrapper *)pyTimer);
timer->start(%1);
</inject-code>