QtDBus: Replace some text-based singnal-slot connections

Use type-checked connections for better run-time
performance and compile-time type checking.

This excludes connections to private slots that are
not trivial to replace.

Change-Id: I97f591dba880f8d09c73565f2b5555524f6ab4a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Ievgenii Meshcheriakov 2023-04-28 13:50:54 +02:00
parent 5a3784bba3
commit 6f05e91695
3 changed files with 6 additions and 6 deletions

View File

@ -52,7 +52,7 @@ QDBusPendingCall pcall = interface->asyncCall("Process"_L1, value);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pcall);
QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
this, SLOT(callFinishedSlot(QDBusPendingCallWatcher*)));
QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this,
&Abstract_DBus_Interface::callFinishedSlot);
//! [1]
}

View File

@ -33,8 +33,8 @@ void DBus_PendingCall_Interface::callInterfaceMain()
QDBusPendingCall async = iface->asyncCall("RemoteMethod", value1, value2);
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this);
QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
this, SLOT(callFinishedSlot(QDBusPendingCallWatcher*)));
QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this,
&DBus_PendingCall_Interface::callFinishedSlot);
//! [0]
}

View File

@ -2428,8 +2428,8 @@ void QDBusConnectionPrivate::registerObject(const ObjectTreeNode *node)
connector->connectAllSignals(node->obj);
}
connect(connector, SIGNAL(relaySignal(QObject*,const QMetaObject*,int,QVariantList)),
this, SLOT(relaySignal(QObject*,const QMetaObject*,int,QVariantList)),
connect(connector, &QDBusAdaptorConnector::relaySignal, this,
&QDBusConnectionPrivate::relaySignal,
Qt::ConnectionType(Qt::QueuedConnection | Qt::UniqueConnection));
}
}