summaryrefslogtreecommitdiffstats
path: root/qt/qdbusreply.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago@kde.org>2006-04-23 15:17:28 +0000
committerThiago Macieira <thiago@kde.org>2006-04-23 15:17:28 +0000
commit02b7fc2df397960e85e13cd1d67a285a22daef22 (patch)
tree83dd08ad3e458c5d76d94115dae658afa08598a6 /qt/qdbusreply.h
parentfe9893510411baff9cb700bea3d37fd19312d02f (diff)
* 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)
Diffstat (limited to 'qt/qdbusreply.h')
-rw-r--r--qt/qdbusreply.h28
1 files changed, 25 insertions, 3 deletions
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<Type>::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(); }