diff options
author | Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> | 2023-08-23 14:23:26 +0200 |
---|---|---|
committer | Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> | 2023-08-28 22:03:02 +0200 |
commit | f87d214000d77093c482336e92d41e39ccfae848 (patch) | |
tree | a7aa638840f83dd606f3eac9476c9b4b58450171 /src/dbus | |
parent | 80520c2f52aeaff4d01b2506d080770888ca8ec7 (diff) |
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus')
-rw-r--r-- | src/dbus/qdbuspendingcall.cpp | 20 | ||||
-rw-r--r-- | src/dbus/qdbuspendingcall.h | 5 |
2 files changed, 3 insertions, 22 deletions
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 |