[Telepathy-commits] [telepathy-qt4/master] Account: Added haveConnection method.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Wed Feb 4 09:57:57 PST 2009


---
 TelepathyQt4/Client/account.cpp |   11 +++++++++++
 TelepathyQt4/Client/account.h   |    1 +
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/TelepathyQt4/Client/account.cpp b/TelepathyQt4/Client/account.cpp
index ef3097b..cafac00 100644
--- a/TelepathyQt4/Client/account.cpp
+++ b/TelepathyQt4/Client/account.cpp
@@ -449,6 +449,17 @@ Telepathy::ConnectionStatusReason Account::connectionStatusReason() const
 }
 
 /**
+ * Return whether this account have a connection object that can be retrieved
+ * using connection().
+ *
+ * \return \c true if a connection object can be retrieved, \c false otherwise
+ */
+bool Account::haveConnection() const
+{
+    return !mPriv->connectionObjectPath.isEmpty();
+}
+
+/**
  * Get the Connection object for this account.
  *
  * Note that the Connection object won't be cached by account, and
diff --git a/TelepathyQt4/Client/account.h b/TelepathyQt4/Client/account.h
index 472ffd1..2432dd3 100644
--- a/TelepathyQt4/Client/account.h
+++ b/TelepathyQt4/Client/account.h
@@ -106,6 +106,7 @@ public:
 
     Telepathy::ConnectionStatus connectionStatus() const;
     Telepathy::ConnectionStatusReason connectionStatusReason() const;
+    bool haveConnection() const;
     QSharedPointer<Connection> connection() const;
 
     Telepathy::SimplePresence automaticPresence() const;
-- 
1.5.6.5




More information about the telepathy-commits mailing list