From 7b78560a4b5260dfa9691e611a9b86dcb0172789 2011-10-18 15:24:30 From: florianlink Date: 2011-10-18 15:24:30 Subject: [PATCH] fixed isSame to use python comparison git-svn-id: svn://svn.code.sf.net/p/pythonqt/code/trunk@199 ea8d5007-eb21-0410-b261-ccb3ea6e24a9 --- diff --git a/src/PythonQtSignalReceiver.cpp b/src/PythonQtSignalReceiver.cpp index 0217c73..b10086a 100644 --- a/src/PythonQtSignalReceiver.cpp +++ b/src/PythonQtSignalReceiver.cpp @@ -132,6 +132,11 @@ PyObject* PythonQtSignalTarget::call(PyObject* callable, const PythonQtMethodInf return result; } +bool PythonQtSignalTarget::isSame( int signalId, PyObject* callable ) const +{ + return PyObject_Compare(callable, _callable) == 0 && signalId==_signalId; +} + //------------------------------------------------------------------------------ PythonQtSignalReceiver::PythonQtSignalReceiver(QObject* obj):PythonQtSignalReceiverBase(obj) diff --git a/src/PythonQtSignalReceiver.h b/src/PythonQtSignalReceiver.h index 210f8d6..49ac0dc 100644 --- a/src/PythonQtSignalReceiver.h +++ b/src/PythonQtSignalReceiver.h @@ -84,7 +84,7 @@ public: void call(void **arguments) const; //! check if it is the same signal target - bool isSame(int signalId, PyObject* callable) const { return callable==_callable && signalId==_signalId; } + bool isSame(int signalId, PyObject* callable) const; //! call the given callable with arguments described by PythonQtMethodInfo, returns a new reference as result value (or NULL) static PyObject* call(PyObject* callable, const PythonQtMethodInfo* methodInfo, void **arguments, bool skipFirstArgumentOfMethodInfo = false);