diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-08-10 09:17:16 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-08-10 09:17:16 +0000 |
| commit | 5ee32c39d36c283a0e330005de922c486a6ae9e2 (patch) | |
| tree | 812fb71fa15f21990de282459579841c61e739ae /source | |
| parent | 7729fa4a4727c724df9e31cc524334f0629c558b (diff) | |
| download | qxmpp-5ee32c39d36c283a0e330005de922c486a6ae9e2.tar.gz | |
deprecate QXmppClient::getClientPresence
Diffstat (limited to 'source')
| -rw-r--r-- | source/QXmppClient.cpp | 27 | ||||
| -rw-r--r-- | source/QXmppClient.h | 13 | ||||
| -rw-r--r-- | source/QXmppReconnectionManager.cpp | 2 |
3 files changed, 25 insertions, 17 deletions
diff --git a/source/QXmppClient.cpp b/source/QXmppClient.cpp index 400ff7e0..d8b7f182 100644 --- a/source/QXmppClient.cpp +++ b/source/QXmppClient.cpp @@ -67,7 +67,9 @@ /// The default value is 0. QXmppClient::QXmppClient(QObject *parent) - : QObject(parent), m_stream(0), m_clientPresence(QXmppPresence::Available), + : QObject(parent), + m_stream(0), + m_clientPresence(QXmppPresence::Available), m_reconnectionManager(0) { m_stream = new QXmppStream(this); @@ -312,6 +314,14 @@ void QXmppClient::sendMessage(const QString& bareJid, const QString& message) } } +/// Returns the client's current presence. +/// + +QXmppPresence QXmppClient::clientPresence() const +{ + return m_clientPresence; +} + /// Changes the presence of the connected client. /// /// If the presence type is QXmppPresence::Unavailable or the presence status @@ -381,16 +391,6 @@ void QXmppClient::setClientPresence(QXmppPresence::Status::Type statusType) setClientPresence(newPresence); } -/// Function to get the client's current presence. -/// -/// \return Constant reference to the client's presence object -/// - -const QXmppPresence& QXmppClient::getClientPresence() const -{ - return m_clientPresence; -} - /// Function to get reconnection manager. By default there exists a reconnection /// manager. See QXmppReconnectionManager for more details of the reconnection /// mechanism. @@ -615,6 +615,11 @@ void QXmppClient::xmppConnected() // obsolete +const QXmppPresence& QXmppClient::getClientPresence() const +{ + return m_clientPresence; +} + QXmppConfiguration& QXmppClient::getConfiguration() { return m_stream->configuration(); diff --git a/source/QXmppClient.h b/source/QXmppClient.h index 5123c6a3..00881bac 100644 --- a/source/QXmppClient.h +++ b/source/QXmppClient.h @@ -110,6 +110,8 @@ public: void disconnect(); bool isConnected() const; + QXmppPresence clientPresence() const; + QXmppConfiguration &configuration(); QXmppLogger *logger(); void setLogger(QXmppLogger *logger); @@ -124,14 +126,13 @@ public: QXmppTransferManager& transferManager(); QXmppVCardManager& vCardManager(); - // FIXME : these accessors should be deprecated in favour of + // FIXME: these accessors should be deprecated in favour of // versions without the "get". QXmppReconnectionManager* getReconnectionManager(); bool setReconnectionManager(QXmppReconnectionManager*); - const QXmppPresence& getClientPresence() const; /// \cond - // These methods are not in keeping with the "manager" approach, + // FIXME: these methods are not in keeping with the "manager" approach, // the whole RPC support either needs some love or should be pulled. void addInvokableInterface( QXmppInvokable *interface ); QXmppRemoteMethodResult callRemoteMethod( const QString &jid, @@ -148,6 +149,7 @@ public: const QVariant &arg10 = QVariant() ); // deprecated accessors, use the form without "get" instead + const QXmppPresence Q_DECL_DEPRECATED & getClientPresence() const; QXmppConfiguration Q_DECL_DEPRECATED & getConfiguration(); const QXmppConfiguration Q_DECL_DEPRECATED & getConfiguration() const; QXmppRosterManager Q_DECL_DEPRECATED & getRoster(); @@ -226,12 +228,13 @@ signals: /// This signal is emitted to send logging messages. void logMessage(QXmppLogger::MessageType type, const QString &msg); -public: public slots: bool sendPacket(const QXmppPacket&); void sendMessage(const QString& bareJid, const QString& message); - void setClientPresence(const QXmppPresence&); + // FIXME: there are too many setClientPresence methods, which makes them + // hard to understand. Also, they should probably not be slots. + void setClientPresence(const QXmppPresence &presence); void setClientPresence(const QString& statusText); void setClientPresence(QXmppPresence::Type presenceType); void setClientPresence(QXmppPresence::Status::Type statusType); diff --git a/source/QXmppReconnectionManager.cpp b/source/QXmppReconnectionManager.cpp index 9595777d..af234a47 100644 --- a/source/QXmppReconnectionManager.cpp +++ b/source/QXmppReconnectionManager.cpp @@ -89,7 +89,7 @@ void QXmppReconnectionManager::reconnect() if(m_client) { emit reconnectingNow(); - m_client->connectToServer(m_client->configuration(), m_client->getClientPresence()); + m_client->connectToServer(m_client->configuration(), m_client->clientPresence()); } } |
