From ce1ab59604a8f430f8f0d293ca28072020b22235 Mon Sep 17 00:00:00 2001 From: Manjeet Dahiya Date: Sun, 20 Sep 2009 03:21:10 +0000 Subject: setReconnectionManager bug and documentation update --- source/QXmppClient.cpp | 11 +++++++++-- source/QXmppClient.h | 21 ++++++++++++++++++--- 2 files changed, 27 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/QXmppClient.cpp b/source/QXmppClient.cpp index 5940860a..e139476b 100644 --- a/source/QXmppClient.cpp +++ b/source/QXmppClient.cpp @@ -285,12 +285,15 @@ QXmppReconnectionManager* QXmppClient::getReconnectionManager() /// Sets the user defined reconnection manager. /// -/// \return true if all the signal-slot connections are done correctly. +/// \return true if all the signal-slot connections are made correctly. /// bool QXmppClient::setReconnectionManager(QXmppReconnectionManager* reconnectionManager) { + if(!reconnectionManager) + return false; + if(m_reconnectionManager) delete m_reconnectionManager; @@ -299,11 +302,15 @@ bool QXmppClient::setReconnectionManager(QXmppReconnectionManager* bool check = connect(this, SIGNAL(connected()), m_reconnectionManager, SLOT(connected())); Q_ASSERT(check); + if(!check) + return false; check = connect(this, SIGNAL(error(QXmppClient::Error)), m_reconnectionManager, SLOT(error(QXmppClient::Error))); Q_ASSERT(check); - + if(!check) + return false; + return true; } diff --git a/source/QXmppClient.h b/source/QXmppClient.h index 2f3934bb..04fbd196 100644 --- a/source/QXmppClient.h +++ b/source/QXmppClient.h @@ -21,6 +21,20 @@ * */ +/// \class QXmppClient +/// \brief The QXmppClient is the main class for using QXmpp. +/// +/// It provides the user all the required functionality to connect to the server +/// and perform operations afterwards. +/// +/// This class will provide the handle/reference to QXmppRoster (roster management), +/// QXmppVCardManager (vCard manager) and QXmppReconnectionManager (reconnection +/// mechanism). +/// +/// By default, a reconnection mechanism exists, which makes sure of reconnecting +/// to the server on dissconnections due to an error. User can have a custom +/// reconnection mechanism as well. +/// #ifndef QXMPPCLIENT_H #define QXMPPCLIENT_H @@ -137,9 +151,10 @@ public slots: private: QXmppStream* m_stream; ///< Pointer to QXmppStream object a wrapper over ///< TCP socket and XMPP protocol - QXmppConfiguration m_config; ///< - QXmppPresence m_clientPrecence; - QXmppReconnectionManager* m_reconnectionManager; + QXmppConfiguration m_config; ///< This object provides the configuration + ///< required for connecting to the XMPP server. + QXmppPresence m_clientPrecence; ///< Stores the current presence of connected client + QXmppReconnectionManager* m_reconnectionManager; ///< Pointer to the reconnection manager }; #endif // QXMPPCLIENT_H -- cgit v1.2.3