summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS10
-rw-r--r--TelepathyQt4Yell/Models/accounts-model-item.cpp16
-rw-r--r--TelepathyQt4Yell/Models/accounts-model-item.h1
3 files changed, 25 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 1ba0915..4460ffc 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,13 @@
+telepathy-qt4-yell 0.1.x
+=========================
+
+Enhancements:
+
+Fixes:
+ * Report the connection status reason using the Connection object if possible
+ * On connection invalidated, emit the connection status changed signal to make sure the account model item is updated
+
+
telepathy-qt4-yell 0.1.6 (2011-06-06)
======================================
diff --git a/TelepathyQt4Yell/Models/accounts-model-item.cpp b/TelepathyQt4Yell/Models/accounts-model-item.cpp
index 5dc056b..9e6d4d8 100644
--- a/TelepathyQt4Yell/Models/accounts-model-item.cpp
+++ b/TelepathyQt4Yell/Models/accounts-model-item.cpp
@@ -183,8 +183,13 @@ QVariant AccountsModelItem::data(int role) const
return Tp::ConnectionStatusDisconnected;
}
}
- case AccountsModel::ConnectionStatusReasonRole:
- return mPriv->mAccount->connectionStatusReason();
+ case AccountsModel::ConnectionStatusReasonRole: {
+ if (!mPriv->mAccount->connection().isNull()) {
+ return mPriv->mAccount->connection()->statusReason();
+ } else {
+ return mPriv->mAccount->connectionStatusReason();
+ }
+ }
case AccountsModel::ContactListStateRole: {
if (!mPriv->mManager.isNull()) {
return mPriv->mManager->state();
@@ -311,6 +316,8 @@ void AccountsModelItem::onConnectionChanged(const Tp::ConnectionPtr &connection)
connect(connection.data(), SIGNAL(statusChanged(Tp::ConnectionStatus)),
SLOT(onStatusChanged(Tp::ConnectionStatus)));
+ connect(connection.data(), SIGNAL(invalidated(Tp::DBusProxy*,QString,QString)),
+ SLOT(onConnectionInvalidated()));
onStatusChanged(connection->status());
mPriv->mManager = connection->contactManager();
@@ -324,6 +331,11 @@ void AccountsModelItem::onConnectionChanged(const Tp::ConnectionPtr &connection)
onContactManagerStateChanged(mPriv->mManager->state());
}
+void AccountsModelItem::onConnectionInvalidated()
+{
+ onStatusChanged(Tp::ConnectionStatusDisconnected);
+}
+
void AccountsModelItem::onContactManagerStateChanged(Tp::ContactListState state)
{
onChanged();
diff --git a/TelepathyQt4Yell/Models/accounts-model-item.h b/TelepathyQt4Yell/Models/accounts-model-item.h
index c73dae9..7ce141d 100644
--- a/TelepathyQt4Yell/Models/accounts-model-item.h
+++ b/TelepathyQt4Yell/Models/accounts-model-item.h
@@ -59,6 +59,7 @@ public:
public Q_SLOTS:
void addKnownContacts();
void onConnectionChanged(const Tp::ConnectionPtr &connection);
+ void onConnectionInvalidated();
Q_SIGNALS:
void connectionStatusChanged(const QString &accountId, int status);