From f87d214000d77093c482336e92d41e39ccfae848 Mon Sep 17 00:00:00 2001 From: Ievgenii Meshcheriakov Date: Wed, 23 Aug 2023 14:23:26 +0200 Subject: QDBusPendingCall: Remove private slot Use connection to a lambda instead. This makes QDBusPendingCallWatcherPrivate obsolete and it is also removed. Change-Id: I3d80ff2da25609c694322e5fef4231600ba346b4 Reviewed-by: Thiago Macieira --- src/dbus/qdbuspendingcall.cpp | 20 +++----------------- src/dbus/qdbuspendingcall.h | 5 ----- 2 files changed, 3 insertions(+), 22 deletions(-) (limited to 'src/dbus') diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp index 875891786a..06d0ebb08c 100644 --- a/src/dbus/qdbuspendingcall.cpp +++ b/src/dbus/qdbuspendingcall.cpp @@ -94,7 +94,8 @@ using namespace Qt::StringLiterals; void QDBusPendingCallWatcherHelper::add(QDBusPendingCallWatcher *watcher) { - connect(this, SIGNAL(finished()), watcher, SLOT(_q_finished()), Qt::QueuedConnection); + connect(this, &QDBusPendingCallWatcherHelper::finished, watcher, + [watcher] { Q_EMIT watcher->finished(watcher); }, Qt::QueuedConnection); } QDBusPendingCallPrivate::~QDBusPendingCallPrivate() @@ -445,28 +446,13 @@ QDBusPendingCall QDBusPendingCall::fromCompletedCall(const QDBusMessage &msg) return QDBusPendingCall(d); } - -class QDBusPendingCallWatcherPrivate: public QObjectPrivate -{ -public: - void _q_finished(); - - Q_DECLARE_PUBLIC(QDBusPendingCallWatcher) -}; - -inline void QDBusPendingCallWatcherPrivate::_q_finished() -{ - Q_Q(QDBusPendingCallWatcher); - emit q->finished(q); -} - /*! Creates a QDBusPendingCallWatcher object to watch for replies on the asynchronous pending call \a call and sets this object's parent to \a parent. */ QDBusPendingCallWatcher::QDBusPendingCallWatcher(const QDBusPendingCall &call, QObject *parent) - : QObject(*new QDBusPendingCallWatcherPrivate, parent), QDBusPendingCall(call) + : QObject(parent), QDBusPendingCall(call) { if (d) { // QDBusPendingCall::d const auto locker = qt_scoped_lock(d->mutex); diff --git a/src/dbus/qdbuspendingcall.h b/src/dbus/qdbuspendingcall.h index eae68144fe..c276376223 100644 --- a/src/dbus/qdbuspendingcall.h +++ b/src/dbus/qdbuspendingcall.h @@ -57,7 +57,6 @@ private: Q_DECLARE_SHARED(QDBusPendingCall) -class QDBusPendingCallWatcherPrivate; class Q_DBUS_EXPORT QDBusPendingCallWatcher: public QObject, public QDBusPendingCall { Q_OBJECT @@ -73,10 +72,6 @@ public: Q_SIGNALS: void finished(QDBusPendingCallWatcher *self = nullptr); - -private: - Q_DECLARE_PRIVATE(QDBusPendingCallWatcher) - Q_PRIVATE_SLOT(d_func(), void _q_finished()) }; QT_END_NAMESPACE -- cgit v1.2.3