From abd1b7f3068e7d4a41adf440d6f6163bfa9f531a Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 8 Sep 2020 12:42:52 +0200 Subject: Cleanup QDBusPendingReply Remove the limitation of max 8 arguments and clean up the template code. This required a bit of special work to ensure QDBusPendingReply works the same way as QDBusPendingReply<>. Change-Id: I8e822b2f97f0712746b917056ea8f3d5c219c7f6 Reviewed-by: Thiago Macieira --- src/dbus/qdbuspendingreply.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/dbus/qdbuspendingreply.cpp') diff --git a/src/dbus/qdbuspendingreply.cpp b/src/dbus/qdbuspendingreply.cpp index df37d92211..f83b3d27a2 100644 --- a/src/dbus/qdbuspendingreply.cpp +++ b/src/dbus/qdbuspendingreply.cpp @@ -95,7 +95,7 @@ */ /*! - \fn template QDBusPendingReply::QDBusPendingReply() + \fn template QDBusPendingReply::QDBusPendingReply() Creates an empty QDBusPendingReply object. Without assigning a QDBusPendingCall object to this reply, QDBusPendingReply cannot do @@ -103,7 +103,7 @@ */ /*! - \fn template QDBusPendingReply::QDBusPendingReply(const QDBusPendingReply &other) + \fn template QDBusPendingReply::QDBusPendingReply(const QDBusPendingReply &other) Creates a copy of the \a other QDBusPendingReply object. Just like QDBusPendingCall and QDBusPendingCallWatcher, this QDBusPendingReply @@ -112,7 +112,7 @@ */ /*! - \fn template QDBusPendingReply::QDBusPendingReply(const QDBusPendingCall &call) + \fn template QDBusPendingReply::QDBusPendingReply(const QDBusPendingCall &call) Creates a QDBusPendingReply object that will take its contents from the \a call pending asynchronous call. This QDBusPendingReply object @@ -120,7 +120,7 @@ */ /*! - \fn template QDBusPendingReply::QDBusPendingReply(const QDBusMessage &message) + \fn template QDBusPendingReply::QDBusPendingReply(const QDBusMessage &message) Creates a QDBusPendingReply object that will take its contents from the message \a message. In this case, this object will be already @@ -130,7 +130,7 @@ */ /*! - \fn template QDBusPendingReply &QDBusPendingReply::operator=(const QDBusPendingReply &other) + \fn template QDBusPendingReply &QDBusPendingReply::operator=(const QDBusPendingReply &other) Makes a copy of \a other and drops the reference to the current pending call. If the current reference is to an unfinished pending @@ -140,7 +140,7 @@ */ /*! - \fn template QDBusPendingReply &QDBusPendingReply::operator=(const QDBusPendingCall &call) + \fn template QDBusPendingReply &QDBusPendingReply::operator=(const QDBusPendingCall &call) Makes this object take its contents from the \a call pending call and drops the reference to the current pending call. If the @@ -150,7 +150,7 @@ */ /*! - \fn template QDBusPendingReply &QDBusPendingReply::operator=(const QDBusMessage &message) + \fn template QDBusPendingReply &QDBusPendingReply::operator=(const QDBusMessage &message) Makes this object take its contents from the \a message message and drops the reference to the current pending call. If the @@ -172,7 +172,7 @@ */ /*! - \fn template int QDBusPendingReply::count() const + \fn template int QDBusPendingReply::count() const Return the number of arguments the reply is supposed to have. This number matches the number of non-void template parameters in this @@ -184,7 +184,7 @@ */ /*! - \fn template QVariant QDBusPendingReply::argumentAt(int index) const + \fn template QVariant QDBusPendingReply::argumentAt(int index) const Returns the argument at position \a index in the reply's contents. If the reply doesn't have that many elements, this @@ -199,7 +199,7 @@ */ /*! - \fn template T1 QDBusPendingReply::value() const + \fn template T1 QDBusPendingReply::value() const Returns the first argument in this reply, cast to type \c T1 (the first template parameter of this class). This is equivalent to @@ -217,7 +217,7 @@ */ /*! - \fn template QDBusPendingReply::operator T1() const + \fn template QDBusPendingReply::operator T1() const Returns the first argument in this reply, cast to type \c T1 (the first template parameter of this class). This is equivalent to @@ -235,7 +235,7 @@ */ /*! - \fn template void QDBusPendingReply::waitForFinished() + \fn template void QDBusPendingReply::waitForFinished() Suspends the execution of the calling thread until the reply is received and processed. After this function returns, isFinished() @@ -245,27 +245,27 @@ \sa QDBusPendingCallWatcher::waitForFinished() */ -QDBusPendingReplyData::QDBusPendingReplyData() +QDBusPendingReplyBase::QDBusPendingReplyBase() : QDBusPendingCall(nullptr) // initialize base class empty { } -QDBusPendingReplyData::~QDBusPendingReplyData() +QDBusPendingReplyBase::~QDBusPendingReplyBase() { } -void QDBusPendingReplyData::assign(const QDBusPendingCall &other) +void QDBusPendingReplyBase::assign(const QDBusPendingCall &other) { QDBusPendingCall::operator=(other); } -void QDBusPendingReplyData::assign(const QDBusMessage &message) +void QDBusPendingReplyBase::assign(const QDBusMessage &message) { d = new QDBusPendingCallPrivate(QDBusMessage(), nullptr); // drops the reference to the old one d->replyMessage = message; } -QVariant QDBusPendingReplyData::argumentAt(int index) const +QVariant QDBusPendingReplyBase::argumentAt(int index) const { if (!d) return QVariant(); @@ -275,7 +275,7 @@ QVariant QDBusPendingReplyData::argumentAt(int index) const return d->replyMessage.arguments().value(index); } -void QDBusPendingReplyData::setMetaTypes(int count, const int *types) +void QDBusPendingReplyBase::setMetaTypes(int count, const int *types) { Q_ASSERT(d); const auto locker = qt_scoped_lock(d->mutex); -- cgit v1.2.3