summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Soliverez <alvaro.soliverez@collabora.co.uk>2011-06-06 10:09:54 -0700
committerAlvaro Soliverez <alvaro.soliverez@collabora.co.uk>2011-06-06 10:11:04 -0700
commit304fa1fc556baebc4adf603f55065ca084696fa9 (patch)
treebcc16eabb06749709de3e17374cfbf8552a4c44d
parent922bc1c1fd57c841fc7293673f776ab49638914e (diff)
Use the connection status to return the status of the account model item
-rw-r--r--TelepathyQt4Yell/Models/accounts-model-item.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/TelepathyQt4Yell/Models/accounts-model-item.cpp b/TelepathyQt4Yell/Models/accounts-model-item.cpp
index 1122003..5dc056b 100644
--- a/TelepathyQt4Yell/Models/accounts-model-item.cpp
+++ b/TelepathyQt4Yell/Models/accounts-model-item.cpp
@@ -175,8 +175,14 @@ QVariant AccountsModelItem::data(int role) const
return mPriv->mAccount->requestedPresence().type();
case AccountsModel::RequestedPresenceStatusMessageRole:
return mPriv->mAccount->requestedPresence().statusMessage();
- case AccountsModel::ConnectionStatusRole:
- return mPriv->mAccount->connectionStatus();
+ case AccountsModel::ConnectionStatusRole: {
+ if (!mPriv->mAccount->connection().isNull()
+ && mPriv->mAccount->connection()->isValid()) {
+ return mPriv->mAccount->connection()->status();
+ } else {
+ return Tp::ConnectionStatusDisconnected;
+ }
+ }
case AccountsModel::ConnectionStatusReasonRole:
return mPriv->mAccount->connectionStatusReason();
case AccountsModel::ContactListStateRole: {