Avoid accessing QObjectPrivate::currentSender directly from QtDBus
authorKent Hansen <kent.hansen@nokia.com>
Thu, 31 May 2012 19:27:47 +0000 (21:27 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 1 Jun 2012 10:03:39 +0000 (12:03 +0200)
In particular, currentSender->signal is about to be changed from
the method index range to the signal index range (i.e., excluding
non-signal methods). The public senderSignalIndex() function will
still return the index in the method range, so QtDBus will then
continue to work without change. If necessary, QtDBus can afterwards
be ported back to using the internal API again (including the new
QMetaObjectPrivate API for working with methods in the signal range).

Change-Id: I58212e859560a8e241adee99dd2da9ef009d4e5b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
src/dbus/qdbusabstractadaptor.cpp

index 39584c4..0d0c09a 100644 (file)
@@ -277,8 +277,7 @@ void QDBusAdaptorConnector::polish()
 
 void QDBusAdaptorConnector::relaySlot(void **argv)
 {
-    QObjectPrivate *d = static_cast<QObjectPrivate *>(d_ptr.data());
-    relay(d->currentSender->sender, d->currentSender->signal, argv);
+    relay(sender(), senderSignalIndex(), argv);
 }
 
 void QDBusAdaptorConnector::relay(QObject *senderObj, int lastSignalIdx, void **argv)