telepathy-qt: BaseConnection: Implemented RequestsInterface::channelClosed () emission.
David Edmundson
davidedmundson at kemper.freedesktop.org
Sun Aug 17 10:55:03 PDT 2014
Module: telepathy-qt
Branch: master
Commit: 5af9bd275a4cdcb1ceb46020bfc9d9bb90810dc3
URL: http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=5af9bd275a4cdcb1ceb46020bfc9d9bb90810dc3
Author: Alexandr Akulich <akulichalexander at gmail.com>
Date: Sat Aug 9 18:38:56 2014 +0600
BaseConnection: Implemented RequestsInterface::channelClosed() emission.
---
TelepathyQt/base-connection.cpp | 13 +++++++++++++
TelepathyQt/base-connection.h | 2 ++
2 files changed, 15 insertions(+)
diff --git a/TelepathyQt/base-connection.cpp b/TelepathyQt/base-connection.cpp
index 1607a53..8684612 100644
--- a/TelepathyQt/base-connection.cpp
+++ b/TelepathyQt/base-connection.cpp
@@ -457,6 +457,14 @@ void BaseConnection::removeChannel()
qobject_cast<BaseChannel*>(sender()));
Q_ASSERT(channel);
Q_ASSERT(mPriv->channels.contains(channel));
+
+ BaseConnectionRequestsInterfacePtr reqIface =
+ BaseConnectionRequestsInterfacePtr::dynamicCast(interface(TP_QT_IFACE_CONNECTION_INTERFACE_REQUESTS));
+
+ if (!reqIface.isNull()) {
+ reqIface->channelClosed(QDBusObjectPath(channel->objectPath()));
+ }
+
mPriv->channels.remove(channel);
}
@@ -738,6 +746,11 @@ void BaseConnectionRequestsInterface::newChannels(const Tp::ChannelDetailsList &
QMetaObject::invokeMethod(mPriv->adaptee,"newChannels", Q_ARG(Tp::ChannelDetailsList,channels)); //Can replace by a direct call in Qt5
}
+void BaseConnectionRequestsInterface::channelClosed(const QDBusObjectPath &removed)
+{
+ QMetaObject::invokeMethod(mPriv->adaptee,"channelClosed", Q_ARG(QDBusObjectPath, removed)); //Can replace by a direct call in Qt5
+}
+
void BaseConnectionRequestsInterface::ensureChannel(const QVariantMap &request, bool &yours,
QDBusObjectPath &objectPath, QVariantMap &details, DBusError *error)
{
diff --git a/TelepathyQt/base-connection.h b/TelepathyQt/base-connection.h
index 2f9cd50..8a638f9 100644
--- a/TelepathyQt/base-connection.h
+++ b/TelepathyQt/base-connection.h
@@ -178,8 +178,10 @@ public:
QDBusObjectPath &channel, QVariantMap &details, DBusError* error);
void createChannel(const QVariantMap &request, QDBusObjectPath &channel,
QVariantMap &details, DBusError* error);
+
public Q_SLOTS:
void newChannels(const Tp::ChannelDetailsList &channels);
+ void channelClosed(const QDBusObjectPath &removed);
protected:
BaseConnectionRequestsInterface(BaseConnection* connection);
More information about the telepathy-commits
mailing list