diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-07-08 01:15:45 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-07-18 13:32:59 +0000 |
commit | 84769bbbce2f175a48c66954cb863e9c0855394b (patch) | |
tree | 2570f0e80a3f35250e5719a6b2000f680b6390e0 /src/dbus/qdbuserror.h | |
parent | 188a8a7f1d5560350749a4f8fa8c205ef3efc215 (diff) |
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus/qdbuserror.h')
-rw-r--r-- | src/dbus/qdbuserror.h | 15 |
1 files changed, 15 insertions, 0 deletions
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 &); |