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>
bb10
Marc Mutz 2015-07-08 01:15:45 +02:00
parent 188a8a7f1d
commit 84769bbbce
1 changed files with 15 additions and 0 deletions

View File

@ -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 &);