From 6f05e916951822f5f3874ac4379f6bda5ea890ef Mon Sep 17 00:00:00 2001 From: Ievgenii Meshcheriakov Date: Fri, 28 Apr 2023 13:50:54 +0200 Subject: [PATCH] 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 --- .../doc/snippets/code/src_qdbus_qdbusabstractinterface.cpp | 4 ++-- src/dbus/doc/snippets/code/src_qdbus_qdbuspendingcall.cpp | 4 ++-- src/dbus/qdbusintegrator.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/dbus/doc/snippets/code/src_qdbus_qdbusabstractinterface.cpp b/src/dbus/doc/snippets/code/src_qdbus_qdbusabstractinterface.cpp index 5348d18ba3..85945ac2c7 100644 --- a/src/dbus/doc/snippets/code/src_qdbus_qdbusabstractinterface.cpp +++ b/src/dbus/doc/snippets/code/src_qdbus_qdbusabstractinterface.cpp @@ -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] } diff --git a/src/dbus/doc/snippets/code/src_qdbus_qdbuspendingcall.cpp b/src/dbus/doc/snippets/code/src_qdbus_qdbuspendingcall.cpp index c44337ade2..67b019a67d 100644 --- a/src/dbus/doc/snippets/code/src_qdbus_qdbuspendingcall.cpp +++ b/src/dbus/doc/snippets/code/src_qdbus_qdbuspendingcall.cpp @@ -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] } diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index d4f61bf2f7..9b37cd7b8c 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -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)); } }