aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtCore
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-07-21 17:57:17 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:38 -0300
commitec45601aa14400b3d3e13f3f326e57d534da6ad2 (patch)
tree6ebaa966bc6518e85408a1807e5741690622f87a /PySide/QtCore
parent9dd8f98e736dc70ae4f1a78f13ee643a63aa2e47 (diff)
Implemented DynamicMetaObject optiomizations.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Lauro Neto <lauro.neto@openbossa.org>
Diffstat (limited to 'PySide/QtCore')
-rw-r--r--PySide/QtCore/glue/qobject_connect.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/PySide/QtCore/glue/qobject_connect.cpp b/PySide/QtCore/glue/qobject_connect.cpp
index 91a272c3c..3296c2e89 100644
--- a/PySide/QtCore/glue/qobject_connect.cpp
+++ b/PySide/QtCore/glue/qobject_connect.cpp
@@ -59,11 +59,10 @@ static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject
return false;
signal++;
- if (!PySide::SignalManager::registerMetaMethod(source, signal, QMetaMethod::Signal))
+ int signalIndex = PySide::SignalManager::registerMetaMethodGetIndex(source, signal, QMetaMethod::Signal);
+ if (signalIndex == -1)
return false;
- int signalIndex = source->metaObject()->indexOfMethod(signal);
-
PySide::SignalManager& signalManager = PySide::SignalManager::instance();
// Extract receiver from callback
@@ -82,13 +81,14 @@ static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject
qWarning() << "You can't add dynamic slots on an object originated from C++.";
return false;
}
- if (usingGlobalReceiver) {
- signalManager.addGlobalSlot(slot, callback);
- } else {
- if (!PySide::SignalManager::registerMetaMethod(receiver, slot, QMetaMethod::Slot))
- return false;
- }
- slotIndex = metaObject->indexOfSlot(slot);
+
+ if (usingGlobalReceiver)
+ slotIndex = signalManager.addGlobalSlotGetIndex(slot, callback);
+ else
+ slotIndex = PySide::SignalManager::registerMetaMethodGetIndex(receiver, slot, QMetaMethod::Slot);
+
+ if (slotIndex == -1)
+ return false;
}
if (QMetaObject::connect(source, signalIndex, receiver, slotIndex, type)) {
if (usingGlobalReceiver)