aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtCore/glue
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/glue
parentb71cade8c68f15591c16639b259628d1fdcb8226 (diff)
Fixed some warning messages during QtCore compilation.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'PySide/QtCore/glue')
-rw-r--r--PySide/QtCore/glue/qobject_connect.cpp8
1 files changed, 6 insertions, 2 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;
}