Skip to content

Commit

Permalink
doc: update dbus sources for clangqdoc
Browse files Browse the repository at this point in the history
Changed some uses of Q_QDOC to Q_CLANG_QDOC;
eliminated some uses of Q_QDOC; correct some
function signatures used for qdoc; added docs
for swap() functions.

Change-Id: I0d3c62d462bd3b10fd35d411bdfb93d952e6423d
Reviewed-by: Martin Smith <martin.smith@qt.io>
  • Loading branch information
Martin Smith committed Dec 8, 2017
1 parent f4ad5ed commit a942721
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 23 deletions.
6 changes: 6 additions & 0 deletions src/dbus/qdbusargument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,12 @@ QDBusArgument &operator<<(QDBusArgument &a, const QLineF &line)
}
#endif

/*!
\fn void QDBusArgument::swap(QDBusArgument &other)
Swaps this QDBusArgument instance with \a other.
*/

QT_END_NAMESPACE

#endif // QT_NO_DBUS
6 changes: 6 additions & 0 deletions src/dbus/qdbusconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,12 @@ QByteArray QDBusConnection::localMachineId()
When using BlockWithGui, applications must be prepared for reentrancy in any function.
*/

/*!
\fn void QDBusConnection::swap(QDBusConnection &other)
Swaps this QDBusConnection instance with \a other.
*/

QT_END_NAMESPACE

#ifdef Q_OS_WIN
Expand Down
6 changes: 6 additions & 0 deletions src/dbus/qdbuserror.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,12 @@ QDebug operator<<(QDebug dbg, const QDBusError &msg)
}
#endif

/*!
\fn void QDBusError::swap(QDBusError &other)
Swaps this QDBusError instance with \a other.
*/

QT_END_NAMESPACE

#endif // QT_NO_DBUS
18 changes: 18 additions & 0 deletions src/dbus/qdbusextratypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,24 @@ void QDBusSignature::doCheck()
\sa signature()
*/

/*!
\fn void QDBusObjectPath::swap(QDBusObjectPath &other)
Swaps this QDBusObjectPath instance with \a other.
*/

/*!
\fn void QDBusSignature::swap(QDBusSignature &other)
Swaps this QDBusSignature instance with \a other.
*/

/*!
\fn void QDBusVariant::swap(QDBusVariant &other)
Swaps this QDBusVariant instance with \a other.
*/

QT_END_NAMESPACE

#endif // QT_NO_DBUS
16 changes: 6 additions & 10 deletions src/dbus/qdbusmessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -777,16 +777,6 @@ QDBusMessage::MessageType QDBusMessage::type() const
return InvalidMessage;
}

/*!
Sends the message without waiting for a reply. This is suitable
for errors, signals, and return values as well as calls whose
return values are not necessary.
Returns \c true if the message was queued successfully;
otherwise returns \c false.
\sa QDBusConnection::send()
*/
#ifndef QT_NO_DEBUG_STREAM
static QDebug operator<<(QDebug dbg, QDBusMessage::MessageType t)
{
Expand Down Expand Up @@ -839,6 +829,12 @@ QDebug operator<<(QDebug dbg, const QDBusMessage &msg)
}
#endif

/*!
\fn void QDBusMessage::swap(QDBusMessage &other)
Swaps this QDBusMessage instance with \a other.
*/

QT_END_NAMESPACE

#endif // QT_NO_DBUS
2 changes: 1 addition & 1 deletion src/dbus/qdbuspendingcall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ QDBusMessage QDBusPendingCall::reply() const
}

#if 0
/*!
/*
Sets the slot \a member in object \a target to be called when the
reply arrives. The slot's parameter list must match the reply
message's arguments for it to be called.
Expand Down
23 changes: 11 additions & 12 deletions src/dbus/qdbuspendingreply.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace QDBusPendingReplyTypes {
template<typename T1 = void, typename T2 = void, typename T3 = void, typename T4 = void,
typename T5 = void, typename T6 = void, typename T7 = void, typename T8 = void>
class QDBusPendingReply:
#ifdef Q_QDOC
#ifdef Q_CLANG_QDOC
public QDBusPendingCall
#else
public QDBusPendingReplyData
Expand Down Expand Up @@ -144,13 +144,21 @@ class QDBusPendingReply:

inline int count() const { return Count; }

#if defined(Q_QDOC)
#if defined(Q_CLANG_QDOC)
QVariant argumentAt(int index) const;
#else
using QDBusPendingReplyData::argumentAt;
#endif

#if defined(Q_QDOC)
template<int Index> inline
const typename Select<Index>::Type argumentAt() const
{
Q_STATIC_ASSERT_X(Index >= 0 && Index < Count, "Index out of bounds");
typedef typename Select<Index>::Type ResultType;
return qdbus_cast<ResultType>(argumentAt(Index), 0);
}

#if defined(Q_CLANG_QDOC)
bool isFinished() const;
void waitForFinished();

Expand All @@ -159,18 +167,9 @@ class QDBusPendingReply:
QDBusError error() const;
QDBusMessage reply() const;

template<int Index> inline Type argumentAt() const;
inline T1 value() const;
inline operator T1() const;
#else
template<int Index> inline
const typename Select<Index>::Type argumentAt() const
{
Q_STATIC_ASSERT_X(Index >= 0 && Index < Count, "Index out of bounds");
typedef typename Select<Index>::Type ResultType;
return qdbus_cast<ResultType>(argumentAt(Index), 0);
}

inline typename Select<0>::Type value() const
{
return argumentAt<0>();
Expand Down

0 comments on commit a942721

Please sign in to comment.