[next] telepathy-qt: Update handleChannel args in FileRecieverHandler demo

David Edmundson davidedmundson at kemper.freedesktop.org
Sat Apr 12 10:25:20 PDT 2014


Module: telepathy-qt
Branch: next
Commit: 02181f4aaa105fcf8abb2cfb26feb01991e695c3
URL:    http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=02181f4aaa105fcf8abb2cfb26feb01991e695c3

Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Sat Apr 12 19:25:41 2014 +0200

Update handleChannel args in FileRecieverHandler demo

---

 examples/file-transfer/file-receiver-handler.cpp |   20 +++++---------------
 examples/file-transfer/file-receiver-handler.h   |    8 +-------
 2 files changed, 6 insertions(+), 22 deletions(-)

diff --git a/examples/file-transfer/file-receiver-handler.cpp b/examples/file-transfer/file-receiver-handler.cpp
index 85d2c61..c7ee80e 100644
--- a/examples/file-transfer/file-receiver-handler.cpp
+++ b/examples/file-transfer/file-receiver-handler.cpp
@@ -51,20 +51,10 @@ bool FileReceiverHandler::bypassApproval() const
     return false;
 }
 
-void FileReceiverHandler::handleChannels(const MethodInvocationContextPtr<> &context,
-        const AccountPtr &account,
-        const ConnectionPtr &connection,
-        const QList<ChannelPtr> &channels,
-        const QList<ChannelRequestPtr> &requestsSatisfied,
-        const QDateTime &userActionTime,
-        const HandlerInfo &handlerInfo)
+void FileReceiverHandler::handleChannel(const MethodInvocationContextPtr<>& context, const AccountPtr& account, const ConnectionPtr& connection, const ChannelPtr& channel, const QVariantMap& channelProperties, const QList< ChannelRequestPtr >& requestsSatisfied, const QDateTime& userActionTime, const AbstractClientHandler::HandlerInfo& handlerInfo)
 {
-    // We should always receive one channel to handle,
-    // otherwise either MC or tp-qt itself is bogus, so let's assert in case they are
-    Q_ASSERT(channels.size() == 1);
-    ChannelPtr chan = channels.first();
 
-    if (!chan->isValid()) {
+    if (!channel->isValid()) {
         qWarning() << "Channel received to handle is invalid, ignoring channel";
         context->setFinishedWithError(TP_QT_ERROR_INVALID_ARGUMENT,
                 QLatin1String("Channel received to handle is invalid"));
@@ -73,10 +63,10 @@ void FileReceiverHandler::handleChannels(const MethodInvocationContextPtr<> &con
 
     // We should always receive incoming channels of type FileTransfer, as set by our filter,
     // otherwise either MC or tp-qt itself is bogus, so let's assert in case they are
-    Q_ASSERT(chan->channelType() == TP_QT_IFACE_CHANNEL_TYPE_FILE_TRANSFER1);
-    Q_ASSERT(!chan->isRequested());
+    Q_ASSERT(channel->channelType() == TP_QT_IFACE_CHANNEL_TYPE_FILE_TRANSFER1);
+    Q_ASSERT(!channel->isRequested());
 
-    IncomingFileTransferChannelPtr transferChannel = IncomingFileTransferChannelPtr::qObjectCast(chan);
+    IncomingFileTransferChannelPtr transferChannel = IncomingFileTransferChannelPtr::qObjectCast(channel);
     Q_ASSERT(transferChannel);
 
     context->setFinished();
diff --git a/examples/file-transfer/file-receiver-handler.h b/examples/file-transfer/file-receiver-handler.h
index 01091dd..c3723e9 100644
--- a/examples/file-transfer/file-receiver-handler.h
+++ b/examples/file-transfer/file-receiver-handler.h
@@ -44,13 +44,7 @@ public:
 
     bool bypassApproval() const;
 
-    void handleChannels(const MethodInvocationContextPtr<> &context,
-            const AccountPtr &account,
-            const ConnectionPtr &connection,
-            const QList<ChannelPtr> &channels,
-            const QList<ChannelRequestPtr> &requestsSatisfied,
-            const QDateTime &userActionTime,
-            const HandlerInfo &handlerInfo);
+    virtual void handleChannel(const MethodInvocationContextPtr<>& context, const AccountPtr& account, const ConnectionPtr& connection, const ChannelPtr& channel, const QVariantMap& channelProperties, const QList< ChannelRequestPtr >& requestsSatisfied, const QDateTime& userActionTime, const HandlerInfo& handlerInfo);
 
 private Q_SLOTS:
     void onReceiveFinished(Tp::PendingOperation *op);



More information about the telepathy-commits mailing list