telepathy-qt: BaseConnection: Implemented graceful disconnection.
Alexandr Akulich
kaffeine at kemper.freedesktop.org
Thu Sep 3 07:12:55 PDT 2015
Module: telepathy-qt
Branch: master
Commit: efb656072f5da8a457cdaca77bbd165287319208
URL: http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=efb656072f5da8a457cdaca77bbd165287319208
Author: Alexandr Akulich <akulichalexander at gmail.com>
Date: Wed Sep 2 23:36:14 2015 +0500
BaseConnection: Implemented graceful disconnection.
Now we properly close channels on disconnect.
Reviewed-by: David Edmundson
---
TelepathyQt/base-connection.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/TelepathyQt/base-connection.cpp b/TelepathyQt/base-connection.cpp
index f681926..93ae17d 100644
--- a/TelepathyQt/base-connection.cpp
+++ b/TelepathyQt/base-connection.cpp
@@ -130,9 +130,16 @@ void BaseConnection::Adaptee::connect(const Tp::Service::ConnectionAdaptor::Conn
void BaseConnection::Adaptee::disconnect(const Tp::Service::ConnectionAdaptor::DisconnectContextPtr &context)
{
debug() << "BaseConnection::Adaptee::disconnect";
- /* This will remove the connection from the connection manager
+
+ foreach(const BaseChannelPtr &channel, mConnection->mPriv->channels) {
+ /* BaseChannel::closed() signal triggers removeChannel() method call with proper cleanup */
+ channel->close();
+ }
+
+ /* This signal will remove the connection from the connection manager
* and destroy this object. */
emit mConnection->disconnected();
+
context->setFinished();
}
More information about the telepathy-commits
mailing list