summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2012-04-06 14:01:43 -0300
committerAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2012-04-06 14:01:56 -0300
commit1c9933cd7dc509779abcc22fd4622cb353798711 (patch)
treef68e87004c089d8f7b63a5ffee0eac16bf837813
parent63ce37b2c1a712892486d208b93a8ca3f44bc1ab (diff)
parent542e0bcb0da2ed461f250f03602b516b3942b6ee (diff)
Merge branch 'svc-fixes'
Reviewed-by: George Kiagiadakis <george.kiagiadakis@collabora.com>
-rw-r--r--TelepathyQt/CMakeLists.txt4
-rw-r--r--TelepathyQt/ServiceTypes13
-rw-r--r--TelepathyQt/base-connection-manager.cpp4
-rw-r--r--TelepathyQt/base-protocol.cpp8
-rw-r--r--TelepathyQt/dbus-service.h1
-rw-r--r--TelepathyQt/method-invocation-context.h9
-rw-r--r--TelepathyQt/service-types.h59
-rw-r--r--TelepathyQt/types.h20
8 files changed, 85 insertions, 33 deletions
diff --git a/TelepathyQt/CMakeLists.txt b/TelepathyQt/CMakeLists.txt
index e8e63f73..6dea4fe6 100644
--- a/TelepathyQt/CMakeLists.txt
+++ b/TelepathyQt/CMakeLists.txt
@@ -852,7 +852,9 @@ if(ENABLE_EXPERIMENTAL_SERVICE_SUPPORT)
DBusObject
dbus-object.h
DBusService
- dbus-service.h)
+ dbus-service.h
+ ServiceTypes
+ service-types.h)
# Generated headers which will be installed and exported
set(telepathy_qt_service_gen_HEADERS
diff --git a/TelepathyQt/ServiceTypes b/TelepathyQt/ServiceTypes
new file mode 100644
index 00000000..a4d8b88d
--- /dev/null
+++ b/TelepathyQt/ServiceTypes
@@ -0,0 +1,13 @@
+#ifndef _TelepathyQt_ServiceTypes_HEADER_GUARD_
+#define _TelepathyQt_ServiceTypes_HEADER_GUARD_
+
+#ifndef IN_TP_QT_HEADER
+#define IN_TP_QT_HEADER
+#endif
+
+#include <TelepathyQt/service-types.h>
+
+#undef IN_TP_QT_HEADER
+
+#endif
+// vim:set ft=cpp:
diff --git a/TelepathyQt/base-connection-manager.cpp b/TelepathyQt/base-connection-manager.cpp
index 7b09136f..ac293381 100644
--- a/TelepathyQt/base-connection-manager.cpp
+++ b/TelepathyQt/base-connection-manager.cpp
@@ -150,12 +150,12 @@ void BaseConnectionManager::Adaptee::requestConnection(const QString &protocolNa
BaseConnectionPtr connection;
connection = protocol->createConnection(parameters, &error);
if (!connection) {
- context->setFinishedWithError(error);
+ context->setFinishedWithError(error.name(), error.message());
return;
}
if (!connection->registerObject(&error)) {
- context->setFinishedWithError(error);
+ context->setFinishedWithError(error.name(), error.message());
return;
}
diff --git a/TelepathyQt/base-protocol.cpp b/TelepathyQt/base-protocol.cpp
index 3e28a0a7..0d386267 100644
--- a/TelepathyQt/base-protocol.cpp
+++ b/TelepathyQt/base-protocol.cpp
@@ -141,7 +141,7 @@ void BaseProtocol::Adaptee::identifyAccount(const QVariantMap &parameters,
QString accountId;
accountId = mProtocol->identifyAccount(parameters, &error);
if (accountId.isEmpty()) {
- context->setFinishedWithError(error);
+ context->setFinishedWithError(error.name(), error.message());
return;
}
context->setFinished(accountId);
@@ -154,7 +154,7 @@ void BaseProtocol::Adaptee::normalizeContact(const QString &contactId,
QString normalizedContactId;
normalizedContactId = mProtocol->normalizeContact(contactId, &error);
if (normalizedContactId.isEmpty()) {
- context->setFinishedWithError(error);
+ context->setFinishedWithError(error.name(), error.message());
return;
}
context->setFinished(normalizedContactId);
@@ -734,7 +734,7 @@ void BaseProtocolAddressingInterface::Adaptee::normalizeVCardAddress(const QStri
QString normalizedAddress;
normalizedAddress = mInterface->normalizeVCardAddress(vCardField, vCardAddress, &error);
if (normalizedAddress.isEmpty()) {
- context->setFinishedWithError(error);
+ context->setFinishedWithError(error.name(), error.message());
return;
}
context->setFinished(normalizedAddress);
@@ -747,7 +747,7 @@ void BaseProtocolAddressingInterface::Adaptee::normalizeContactURI(const QString
QString normalizedUri;
normalizedUri = mInterface->normalizeContactUri(uri, &error);
if (normalizedUri.isEmpty()) {
- context->setFinishedWithError(error);
+ context->setFinishedWithError(error.name(), error.message());
return;
}
context->setFinished(normalizedUri);
diff --git a/TelepathyQt/dbus-service.h b/TelepathyQt/dbus-service.h
index 81b09162..59f6d2bf 100644
--- a/TelepathyQt/dbus-service.h
+++ b/TelepathyQt/dbus-service.h
@@ -30,6 +30,7 @@
#include <TelepathyQt/DBusError>
#include <TelepathyQt/Global>
#include <TelepathyQt/Object>
+#include <TelepathyQt/ServiceTypes>
#include <QObject>
#include <QVariantMap>
diff --git a/TelepathyQt/method-invocation-context.h b/TelepathyQt/method-invocation-context.h
index 60355d45..79f6476e 100644
--- a/TelepathyQt/method-invocation-context.h
+++ b/TelepathyQt/method-invocation-context.h
@@ -27,8 +27,6 @@
#error IN_TP_QT_HEADER
#endif
-#include <TelepathyQt/DBusError>
-
#include <QtDBus>
#include <QtCore>
@@ -158,11 +156,6 @@ public:
onFinished();
}
- void setFinishedWithError(const DBusError &error)
- {
- setFinishedWithError(error.name(), error.message());
- }
-
template<int Index> inline
typename Select<Index>::Type argumentAt() const
{
@@ -187,7 +180,7 @@ private:
QDBusConnection mBus;
QDBusMessage mMessage;
bool mFinished;
- QVariantList mReply;
+ QList<QVariant> mReply;
QString mErrorName;
QString mErrorMessage;
};
diff --git a/TelepathyQt/service-types.h b/TelepathyQt/service-types.h
new file mode 100644
index 00000000..5c33bd43
--- /dev/null
+++ b/TelepathyQt/service-types.h
@@ -0,0 +1,59 @@
+/**
+ * This file is part of TelepathyQt
+ *
+ * @copyright Copyright (C) 2012 Collabora Ltd. <http://www.collabora.co.uk/>
+ * @copyright Copyright (C) 2012 Nokia Corporation
+ * @license LGPL 2.1
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _TelepathyQt_service_types_h_HEADER_GUARD_
+#define _TelepathyQt_service_types_h_HEADER_GUARD_
+
+#ifndef IN_TP_QT_HEADER
+#error IN_TP_QT_HEADER
+#endif
+
+#include <TelepathyQt/Types>
+
+namespace Tp
+{
+
+class AbstractProtocolInterface;
+class BaseConnection;
+class BaseConnectionManager;
+class BaseProtocol;
+class BaseProtocolAddressingInterface;
+class BaseProtocolAvatarsInterface;
+class BaseProtocolPresenceInterface;
+class DBusService;
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+
+typedef SharedPtr<AbstractProtocolInterface> AbstractProtocolInterfacePtr;
+typedef SharedPtr<BaseConnection> BaseConnectionPtr;
+typedef SharedPtr<BaseConnectionManager> BaseConnectionManagerPtr;
+typedef SharedPtr<BaseProtocol> BaseProtocolPtr;
+typedef SharedPtr<BaseProtocolAddressingInterface> BaseProtocolAddressingInterfacePtr;
+typedef SharedPtr<BaseProtocolAvatarsInterface> BaseProtocolAvatarsInterfacePtr;
+typedef SharedPtr<BaseProtocolPresenceInterface> BaseProtocolPresenceInterfacePtr;
+typedef SharedPtr<DBusService> DBusServicePtr;
+
+#endif /* DOXYGEN_SHOULD_SKIP_THIS */
+
+} // Tp
+
+#endif
diff --git a/TelepathyQt/types.h b/TelepathyQt/types.h
index d0682a80..1edb09bf 100644
--- a/TelepathyQt/types.h
+++ b/TelepathyQt/types.h
@@ -1,8 +1,8 @@
/**
* This file is part of TelepathyQt
*
- * @copyright Copyright (C) 2008 Collabora Ltd. <http://www.collabora.co.uk/>
- * @copyright Copyright (C) 2008 Nokia Corporation
+ * @copyright Copyright (C) 2008-2012 Collabora Ltd. <http://www.collabora.co.uk/>
+ * @copyright Copyright (C) 2008-2012 Nokia Corporation
* @license LGPL 2.1
*
* This library is free software; you can redistribute it and/or
@@ -48,7 +48,6 @@ class AbstractClient;
class AbstractClientApprover;
class AbstractClientHandler;
class AbstractClientObserver;
-class AbstractProtocolInterface;
class Account;
typedef GenericCapabilityFilter<Account> AccountCapabilityFilter;
class AccountFactory;
@@ -60,12 +59,6 @@ class CallChannel;
class CallContent;
class CallStream;
class CaptchaAuthentication;
-class BaseConnection;
-class BaseConnectionManager;
-class BaseProtocol;
-class BaseProtocolAddressingInterface;
-class BaseProtocolAvatarsInterface;
-class BaseProtocolPresenceInterface;
class Channel;
class ChannelDispatchOperation;
class ChannelFactory;
@@ -83,7 +76,6 @@ class ContactManager;
class ContactMessenger;
class ContactSearchChannel;
class DBusProxy;
-class DBusService;
class FileTransferChannel;
class IncomingFileTransferChannel;
class IncomingStreamTubeChannel;
@@ -110,7 +102,6 @@ typedef SharedPtr<AbstractClient> AbstractClientPtr;
typedef SharedPtr<AbstractClientApprover> AbstractClientApproverPtr;
typedef SharedPtr<AbstractClientHandler> AbstractClientHandlerPtr;
typedef SharedPtr<AbstractClientObserver> AbstractClientObserverPtr;
-typedef SharedPtr<AbstractProtocolInterface> AbstractProtocolInterfacePtr;
typedef SharedPtr<Account> AccountPtr;
typedef SharedPtr<AccountCapabilityFilter> AccountCapabilityFilterPtr;
typedef SharedPtr<const AccountCapabilityFilter> AccountCapabilityFilterConstPtr;
@@ -126,12 +117,6 @@ typedef SharedPtr<CallChannel> CallChannelPtr;
typedef SharedPtr<CallContent> CallContentPtr;
typedef SharedPtr<CallStream> CallStreamPtr;
typedef SharedPtr<CaptchaAuthentication> CaptchaAuthenticationPtr;
-typedef SharedPtr<BaseConnection> BaseConnectionPtr;
-typedef SharedPtr<BaseConnectionManager> BaseConnectionManagerPtr;
-typedef SharedPtr<BaseProtocol> BaseProtocolPtr;
-typedef SharedPtr<BaseProtocolAddressingInterface> BaseProtocolAddressingInterfacePtr;
-typedef SharedPtr<BaseProtocolAvatarsInterface> BaseProtocolAvatarsInterfacePtr;
-typedef SharedPtr<BaseProtocolPresenceInterface> BaseProtocolPresenceInterfacePtr;
typedef SharedPtr<Channel> ChannelPtr;
typedef SharedPtr<ChannelDispatchOperation> ChannelDispatchOperationPtr;
typedef SharedPtr<ChannelFactory> ChannelFactoryPtr;
@@ -155,7 +140,6 @@ typedef SharedPtr<ContactManager> ContactManagerPtr;
typedef SharedPtr<ContactMessenger> ContactMessengerPtr;
typedef SharedPtr<ContactSearchChannel> ContactSearchChannelPtr;
typedef SharedPtr<DBusProxy> DBusProxyPtr;
-typedef SharedPtr<DBusService> DBusServicePtr;
typedef SharedPtr<FileTransferChannel> FileTransferChannelPtr;
typedef SharedPtr<IncomingFileTransferChannel> IncomingFileTransferChannelPtr;
typedef SharedPtr<IncomingStreamTubeChannel> IncomingStreamTubeChannelPtr;