aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtCore
diff options
context:
space:
mode:
authorrenato <renato.filho@openbossa.org>2010-01-28 17:37:18 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-01-28 18:42:21 -0300
commit10a6f08867eabb63361407ec148bd66e0ac3ebce (patch)
tree92ea4e9881f0eda7ba0f47c2a274d88cc97f7035 /PySide/QtCore
parentb71cade8c68f15591c16639b259628d1fdcb8226 (diff)
Fixed some warning messages during QtCore compilation.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'PySide/QtCore')
-rw-r--r--PySide/QtCore/glue/qobject_connect.cpp8
-rw-r--r--PySide/QtCore/typesystem_core.xml2
2 files changed, 6 insertions, 4 deletions
diff --git a/PySide/QtCore/glue/qobject_connect.cpp b/PySide/QtCore/glue/qobject_connect.cpp
index 63a1d034b..5d9143f7c 100644
--- a/PySide/QtCore/glue/qobject_connect.cpp
+++ b/PySide/QtCore/glue/qobject_connect.cpp
@@ -45,7 +45,7 @@ static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject
// Extract receiver from callback
bool usingGlobalReceiver;
QObject* receiver = 0;
- PyObject* self;
+ PyObject* self = 0;
if (PyMethod_Check(callback)) {
self = PyMethod_GET_SELF(callback);
if (SbkQObject_Check(self))
@@ -54,7 +54,11 @@ static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject
self = PyCFunction_GET_SELF(callback);
if (self && SbkQObject_Check(self))
receiver = SbkQObject_cptr(self);
+ } else if (!PyFunction_Check(callback)) {
+ qWarning() << "Invalid callback object.";
+ return false;
}
+
usingGlobalReceiver = !receiver;
if (usingGlobalReceiver)
receiver = signalManager.globalReceiver();
@@ -64,7 +68,7 @@ static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject
const char* slot = callbackSig.constData();
int slotIndex = metaObject->indexOfSlot(slot);
if (slotIndex == -1) {
- if (!usingGlobalReceiver and !((SbkBaseWrapper*)self)->containsCppWrapper) {
+ if (!usingGlobalReceiver and self and !((SbkBaseWrapper*)self)->containsCppWrapper) {
qWarning() << "You can't add dynamic slots on an object originated from C++.";
return false;
}
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index ce1534552..c20b1dea9 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1453,7 +1453,6 @@
<modify-function signature="findChild(const QString &amp;) const" remove="all" />
<add-function signature="findChild(PyTypeObject*, const QString&amp;)" return-type="PyObject*">
<inject-code class="target" position="beginning">
- const char* type_name = %PYARG_1->ob_type->tp_name;
const bool isEmpty = %2.isEmpty();
foreach(QObject* o, %CPPSELF.children()) {
if (isEmpty || %2 == o->objectName()) {
@@ -1470,7 +1469,6 @@
<add-function signature="findChildren(PyTypeObject*, const QString&amp;)" return-type="PySequence*" >
<inject-code class="target" position="beginning">
%PYARG_0 = PyList_New(0);
- const char* type_name = %PYARG_1->ob_type->tp_name;
const bool isEmpty = %2.isEmpty();
foreach(QObject* o, %CPPSELF.children()) {
if (isEmpty || %2 == o->objectName()) {