From 94c24fad59ef1f62838108f9d460cb25e69e55b4 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 8 Jul 2015 01:13:37 +0200 Subject: [PATCH] QDBusConnection: declare as shared-come-Qt6 Requires adding member-swap and (at least in my copy) move operations. Change-Id: I1b638a81e4a41f467e69e352806524039e7b9f27 Reviewed-by: Thiago Macieira --- src/dbus/qdbusconnection.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/dbus/qdbusconnection.h b/src/dbus/qdbusconnection.h index 4cf7e22ebe..8b2e9234aa 100644 --- a/src/dbus/qdbusconnection.h +++ b/src/dbus/qdbusconnection.h @@ -122,9 +122,14 @@ public: explicit QDBusConnection(const QString &name); QDBusConnection(const QDBusConnection &other); +#ifdef Q_COMPILER_RVALUE_REFS + QDBusConnection(QDBusConnection &&other) Q_DECL_NOTHROW : d(other.d) { other.d = Q_NULLPTR; } + QDBusConnection &operator=(QDBusConnection &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif + QDBusConnection &operator=(const QDBusConnection &other); ~QDBusConnection(); - QDBusConnection &operator=(const QDBusConnection &other); + void swap(QDBusConnection &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool isConnected() const; QString baseService() const; @@ -200,6 +205,7 @@ private: friend class QDBusConnectionPrivate; QDBusConnectionPrivate *d; }; +Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QDBusConnection) Q_DECLARE_OPERATORS_FOR_FLAGS(QDBusConnection::RegisterOptions) Q_DECLARE_OPERATORS_FOR_FLAGS(QDBusConnection::VirtualObjectRegisterOptions)