From 84769bbbce2f175a48c66954cb863e9c0855394b Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 8 Jul 2015 01:15:45 +0200 Subject: QDBusError: declare as shared-come-Qt6 Requires adding member-swap and (at least in my copy) move operations. Change-Id: I4284484b1f520eb2d9036b993a5b5b70aaea0af9 Reviewed-by: Thiago Macieira --- src/dbus/qdbuserror.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/dbus') diff --git a/src/dbus/qdbuserror.h b/src/dbus/qdbuserror.h index c2c0ff8fc5..ce5275dee9 100644 --- a/src/dbus/qdbuserror.h +++ b/src/dbus/qdbuserror.h @@ -92,11 +92,25 @@ public: #endif QDBusError(ErrorType error, const QString &message); QDBusError(const QDBusError &other); +#ifdef Q_COMPILER_RVALUE_REFS + QDBusError(QDBusError &&other) Q_DECL_NOTHROW + : code(other.code), msg(std::move(other.msg)), nm(std::move(other.nm)), unused(other.unused) + { other.unused = Q_NULLPTR; } + QDBusError &operator=(QDBusError &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QDBusError &operator=(const QDBusError &other); #ifndef QT_BOOTSTRAPPED QDBusError &operator=(const QDBusMessage &msg); #endif + void swap(QDBusError &other) Q_DECL_NOTHROW + { + qSwap(code, other.code); + qSwap(msg, other.msg); + qSwap(nm, other.nm); + qSwap(unused, other.unused); + } + ErrorType type() const; QString name() const; QString message() const; @@ -110,6 +124,7 @@ private: QString nm; void *unused; }; +Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QDBusError) #ifndef QT_NO_DEBUG_STREAM Q_DBUS_EXPORT QDebug operator<<(QDebug, const QDBusError &); -- cgit v1.2.3