From b58b777cb3df1df3725c601b655128ce875a8687 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 5 Apr 2012 14:49:02 +0200 Subject: QtDBus: add member-swap to shared classes Implemented as in other shared classes (e.g. QPen). Change-Id: Ic827540b535fc5506165b5395b796a53a00bb096 Reviewed-by: Thiago Macieira --- src/dbus/qdbuspendingcall.cpp | 8 ++++++++ src/dbus/qdbuspendingcall.h | 2 ++ src/dbus/qdbusunixfiledescriptor.cpp | 8 ++++++++ src/dbus/qdbusunixfiledescriptor.h | 3 +++ 4 files changed, 21 insertions(+) (limited to 'src/dbus') diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp index 9659afa2e5..3d5dc421d7 100644 --- a/src/dbus/qdbuspendingcall.cpp +++ b/src/dbus/qdbuspendingcall.cpp @@ -285,6 +285,14 @@ QDBusPendingCall &QDBusPendingCall::operator=(const QDBusPendingCall &other) return *this; } +/*! + \fn void QDBusPendingCall::swap(QDBusPendingCall &other) + \since 5.0 + + Swaps this pending call instance with \a other. This function is + very fast and never fails. +*/ + /*! \fn bool QDBusPendingCallWatcher::isFinished() const diff --git a/src/dbus/qdbuspendingcall.h b/src/dbus/qdbuspendingcall.h index 8655435501..0256c4cc6e 100644 --- a/src/dbus/qdbuspendingcall.h +++ b/src/dbus/qdbuspendingcall.h @@ -68,6 +68,8 @@ public: ~QDBusPendingCall(); QDBusPendingCall &operator=(const QDBusPendingCall &other); + void swap(QDBusPendingCall &other) { qSwap(d, other.d); } + #ifndef Q_QDOC // pretend that they aren't here bool isFinished() const; diff --git a/src/dbus/qdbusunixfiledescriptor.cpp b/src/dbus/qdbusunixfiledescriptor.cpp index bcf5f64a90..b5e8817ddc 100644 --- a/src/dbus/qdbusunixfiledescriptor.cpp +++ b/src/dbus/qdbusunixfiledescriptor.cpp @@ -186,6 +186,14 @@ QDBusUnixFileDescriptor::~QDBusUnixFileDescriptor() { } +/*! + \fn void QDBusUnixFileDescriptor::swap(QDBusUnixFileDescriptor &other) + \since 5.0 + + Swaps this file descriptor instance with \a other. This function + is very fast and never fails. +*/ + /*! Returns true if this Unix file descriptor is valid. A valid Unix file descriptor is not -1. diff --git a/src/dbus/qdbusunixfiledescriptor.h b/src/dbus/qdbusunixfiledescriptor.h index bfb2262a31..9fe0b77230 100644 --- a/src/dbus/qdbusunixfiledescriptor.h +++ b/src/dbus/qdbusunixfiledescriptor.h @@ -68,6 +68,9 @@ public: QDBusUnixFileDescriptor &operator=(const QDBusUnixFileDescriptor &other); ~QDBusUnixFileDescriptor(); + void swap(QDBusUnixFileDescriptor &other) + { qSwap(d, other.d); } + bool isValid() const; int fileDescriptor() const; -- cgit v1.2.3