From 02b7fc2df397960e85e13cd1d67a285a22daef22 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 23 Apr 2006 15:17:28 +0000 Subject: * qt/qdbusreply.h: Add default constructor and operator= (r532625) * qt/qdbustypehelper_p.h: Use a clean namespace: no foreach() in public headers (r532952) * qt/qdbusabstractinterface.cpp: * qt/qdbusabstractinterface_p.h: Add the AutoDetect mode and make it the default (r532951) --- qt/qdbusreply.h | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'qt/qdbusreply.h') diff --git a/qt/qdbusreply.h b/qt/qdbusreply.h index f22082c6..ff0d5d5d 100644 --- a/qt/qdbusreply.h +++ b/qt/qdbusreply.h @@ -39,15 +39,37 @@ class QDBUS_EXPORT QDBusReply typedef T Type; public: inline QDBusReply(const QDBusMessage &reply) - : m_error(reply), m_data(Type()) + : m_data(Type()) { + *this = reply; + } + inline QDBusReply& operator=(const QDBusMessage& reply) + { + m_error = reply; if (isSuccess()) m_data = QDBusTypeHelper::fromVariant(reply.at(0)); + else + m_data = Type(); + return *this; } - inline QDBusReply(const QDBusError &error) + + inline QDBusReply(const QDBusError &error = QDBusError()) : m_error(error), m_data(Type()) { - } + } + inline QDBusReply& operator=(const QDBusError& error) + { + m_error = error; + m_data = Type(); + return *this; + } + + inline QDBusReply& operator=(const QDBusReply& other) + { + m_error = other.m_error; + m_data = other.m_data; + return *this; + } inline bool isError() const { return m_error.isValid(); } inline bool isSuccess() const { return !m_error.isValid(); } -- cgit