From dc131e3a5378d84026941e6626db524688b988f4 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 11 Jan 2013 11:25:28 -0800 Subject: Make QDBusPendingReply behave like QDBusReply when dealing with errors QDBusReply allows one to extract a QVariant and the type reply from an error reply and getting a default-constructed value. This is useful when a valid reply can never contain the default-constructed value (0, false, empty strings, empty arrays, etc.), so it simplifies error checking. More importantly, qdbusxml2cpp was changed a while ago from generating QDBusReply to generating QDBusPendingReply, so we need to have the same behavior. Task-number: QTBUG-29046 Change-Id: Ia873b9fd4311c0d4e94f0ef623ba405c20bc0e8c Reviewed-by: Olivier Goffart --- src/dbus/qdbuspendingreply.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/dbus/qdbuspendingreply.h') diff --git a/src/dbus/qdbuspendingreply.h b/src/dbus/qdbuspendingreply.h index 47a82363db..6511d2df2c 100644 --- a/src/dbus/qdbuspendingreply.h +++ b/src/dbus/qdbuspendingreply.h @@ -168,9 +168,7 @@ public: template inline const typename Select::Type argumentAt() const { - // static assert? - Q_ASSERT_X(Index < count() && Index >= 0, "QDBusPendingReply::argumentAt", - "Index out of bounds"); + Q_STATIC_ASSERT_X(Index >= 0 && Index < Count, "Index out of bounds"); typedef typename Select::Type ResultType; return qdbus_cast(argumentAt(Index), 0); } -- cgit v1.2.3