Skip to content

Commit

Permalink
QtDBus: add member-swap to shared classes
Browse files Browse the repository at this point in the history
Implemented as in other shared classes (e.g. QPen).

Change-Id: Ic827540b535fc5506165b5395b796a53a00bb096
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
  • Loading branch information
marc-kdab authored and Qt by Nokia committed May 9, 2012
1 parent 7fbc80f commit b58b777
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/dbus/qdbuspendingcall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/dbus/qdbuspendingcall.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class Q_DBUS_EXPORT QDBusPendingCall
~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;
Expand Down
8 changes: 8 additions & 0 deletions src/dbus/qdbusunixfiledescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions src/dbus/qdbusunixfiledescriptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ class Q_DBUS_EXPORT QDBusUnixFileDescriptor
QDBusUnixFileDescriptor &operator=(const QDBusUnixFileDescriptor &other);
~QDBusUnixFileDescriptor();

void swap(QDBusUnixFileDescriptor &other)
{ qSwap(d, other.d); }

bool isValid() const;

int fileDescriptor() const;
Expand Down

0 comments on commit b58b777

Please sign in to comment.