telepathy-qt: BaseConnection: inspectHandles() exposed as a part of C++ interface.
Alexandr Akulich
kaffeine at kemper.freedesktop.org
Wed May 6 01:10:28 PDT 2015
Module: telepathy-qt
Branch: master
Commit: c056a72358c7baef0f2f725d9b533c0195283d76
URL: http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=c056a72358c7baef0f2f725d9b533c0195283d76
Author: Alexandr Akulich <akulichalexander at gmail.com>
Date: Tue Apr 21 13:01:57 2015 +0500
BaseConnection: inspectHandles() exposed as a part of C++ interface.
Reviewed-by: David Edmundson
---
TelepathyQt/base-connection.cpp | 17 +++++++++++------
TelepathyQt/base-connection.h | 1 +
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/TelepathyQt/base-connection.cpp b/TelepathyQt/base-connection.cpp
index b5dd97b..6070f4c 100644
--- a/TelepathyQt/base-connection.cpp
+++ b/TelepathyQt/base-connection.cpp
@@ -157,17 +157,13 @@ void BaseConnection::Adaptee::inspectHandles(uint handleType,
const Tp::UIntList &handles,
const Tp::Service::ConnectionAdaptor::InspectHandlesContextPtr &context)
{
- if (!mConnection->mPriv->inspectHandlesCB.isValid()) {
- context->setFinishedWithError(TP_QT_ERROR_NOT_IMPLEMENTED, QLatin1String("Not implemented"));
- return;
- }
DBusError error;
- QStringList ret = mConnection->mPriv->inspectHandlesCB(handleType, handles, &error);
+ QStringList identifiers = mConnection->inspectHandles(handleType, handles, &error);
if (error.isValid()) {
context->setFinishedWithError(error.name(), error.message());
return;
}
- context->setFinished(ret);
+ context->setFinished(identifiers);
}
void BaseConnection::Adaptee::listChannels(const Service::ConnectionAdaptor::ListChannelsContextPtr &context)
@@ -408,6 +404,15 @@ void BaseConnection::setInspectHandlesCallback(const InspectHandlesCallback &cb)
mPriv->inspectHandlesCB = cb;
}
+QStringList BaseConnection::inspectHandles(uint handleType, const Tp::UIntList &handles, DBusError *error)
+{
+ if (!mPriv->inspectHandlesCB.isValid()) {
+ error->set(TP_QT_ERROR_NOT_IMPLEMENTED, QLatin1String("Not implemented"));
+ return QStringList();
+ }
+ return mPriv->inspectHandlesCB(handleType, handles, error);
+}
+
void BaseConnection::setRequestHandlesCallback(const RequestHandlesCallback &cb)
{
mPriv->requestHandlesCB = cb;
diff --git a/TelepathyQt/base-connection.h b/TelepathyQt/base-connection.h
index 59ffadc..d69d19f 100644
--- a/TelepathyQt/base-connection.h
+++ b/TelepathyQt/base-connection.h
@@ -85,6 +85,7 @@ public:
typedef Callback3<QStringList, uint, const Tp::UIntList &, DBusError*> InspectHandlesCallback;
void setInspectHandlesCallback(const InspectHandlesCallback &cb);
+ QStringList inspectHandles(uint handleType, const Tp::UIntList &handles, DBusError *error);
typedef Callback3<UIntList, uint, const QStringList&, DBusError*> RequestHandlesCallback;
void setRequestHandlesCallback(const RequestHandlesCallback &cb);
More information about the telepathy-commits
mailing list