telepathy-qt: debug-receiver: Add class PendingDebugMessageList
Dario Freddi
drf at kemper.freedesktop.org
Mon Jul 2 07:53:54 PDT 2012
Module: telepathy-qt
Branch: master
Commit: 99968e5736c0690b332dd0f0d44a710f8f442d50
URL: http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=99968e5736c0690b332dd0f0d44a710f8f442d50
Author: George Kiagiadakis <george.kiagiadakis at collabora.com>
Date: Sun Dec 11 19:43:51 2011 +0200
debug-receiver: Add class PendingDebugMessageList
---
TelepathyQt/CMakeLists.txt | 4 ++
TelepathyQt/PendingDebugMessageList | 13 +++++
TelepathyQt/pending-debug-message-list.cpp | 67 ++++++++++++++++++++++++++++
TelepathyQt/pending-debug-message-list.h | 56 +++++++++++++++++++++++
4 files changed, 140 insertions(+), 0 deletions(-)
diff --git a/TelepathyQt/CMakeLists.txt b/TelepathyQt/CMakeLists.txt
index b2b63cf..3107e22 100644
--- a/TelepathyQt/CMakeLists.txt
+++ b/TelepathyQt/CMakeLists.txt
@@ -91,6 +91,7 @@ set(telepathy_qt_SRCS
pending-contact-attributes.cpp
pending-contact-info.cpp
pending-contacts.cpp
+ pending-debug-message-list.cpp
pending-handles.cpp
pending-operation.cpp
pending-ready.cpp
@@ -390,6 +391,8 @@ set(telepathy_qt_HEADERS
pending-contact-info.h
PendingContacts
pending-contacts.h
+ PendingDebugMessageList
+ pending-debug-message-list.h
PendingFailure
PendingHandles
pending-handles.h
@@ -562,6 +565,7 @@ set(telepathy_qt_MOC_SRCS
pending-contact-info.h
pending-contacts.h
pending-contacts-internal.h
+ pending-debug-message-list.h
pending-handles.h
pending-operation.h
pending-ready.h
diff --git a/TelepathyQt/PendingDebugMessageList b/TelepathyQt/PendingDebugMessageList
new file mode 100644
index 0000000..5a3b104
--- /dev/null
+++ b/TelepathyQt/PendingDebugMessageList
@@ -0,0 +1,13 @@
+#ifndef _TelepathyQt_PendingDebugMessageList_HEADER_GUARD_
+#define _TelepathyQt_PendingDebugMessageList_HEADER_GUARD_
+
+#ifndef IN_TP_QT_HEADER
+#define IN_TP_QT_HEADER
+#endif
+
+#include <TelepathyQt/pending-debug-message-list.h>
+
+#undef IN_TP_QT_HEADER
+
+#endif
+// vim:set ft=cpp:
diff --git a/TelepathyQt/pending-debug-message-list.cpp b/TelepathyQt/pending-debug-message-list.cpp
new file mode 100644
index 0000000..8039a59
--- /dev/null
+++ b/TelepathyQt/pending-debug-message-list.cpp
@@ -0,0 +1,67 @@
+/**
+ * This file is part of TelepathyQt
+ *
+ * @copyright Copyright (C) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
+ * @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
+ */
+
+#include <TelepathyQt/PendingDebugMessageList>
+
+#include "TelepathyQt/_gen/pending-debug-message-list.moc.hpp"
+
+#include <QtDBus/QDBusPendingCallWatcher>
+
+namespace Tp
+{
+
+struct TP_QT_NO_EXPORT PendingDebugMessageList::Private
+{
+ DebugMessageList result;
+};
+
+PendingDebugMessageList::PendingDebugMessageList(QDBusPendingCall call, const SharedPtr<RefCounted> &object)
+ : PendingOperation(object),
+ mPriv(new Private)
+{
+ connect(new QDBusPendingCallWatcher(call),
+ SIGNAL(finished(QDBusPendingCallWatcher*)),
+ SLOT(watcherFinished(QDBusPendingCallWatcher*)));
+}
+
+PendingDebugMessageList::~PendingDebugMessageList()
+{
+ delete mPriv;
+}
+
+DebugMessageList PendingDebugMessageList::result() const
+{
+ return mPriv->result;
+}
+
+void PendingDebugMessageList::watcherFinished(QDBusPendingCallWatcher *watcher)
+{
+ QDBusPendingReply<DebugMessageList> reply = *watcher;
+ if (reply.isError()) {
+ setFinishedWithError(reply.error());
+ } else {
+ mPriv->result = reply.value();
+ setFinished();
+ }
+ watcher->deleteLater();
+}
+
+}
diff --git a/TelepathyQt/pending-debug-message-list.h b/TelepathyQt/pending-debug-message-list.h
new file mode 100644
index 0000000..b02b8a0
--- /dev/null
+++ b/TelepathyQt/pending-debug-message-list.h
@@ -0,0 +1,56 @@
+/**
+ * This file is part of TelepathyQt
+ *
+ * @copyright Copyright (C) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
+ * @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_pending_debug_message_list_h_HEADER_GUARD_
+#define _TelepathyQt_pending_debug_message_list_h_HEADER_GUARD_
+
+#ifndef IN_TP_QT_HEADER
+#error IN_TP_QT_HEADER
+#endif
+
+#include <TelepathyQt/Types>
+#include <TelepathyQt/PendingOperation>
+
+namespace Tp
+{
+
+class TP_QT_EXPORT PendingDebugMessageList : public Tp::PendingOperation
+{
+ Q_OBJECT
+ Q_DISABLE_COPY(PendingDebugMessageList)
+public:
+ PendingDebugMessageList(QDBusPendingCall call, const SharedPtr<RefCounted> &object);
+ virtual ~PendingDebugMessageList();
+
+ DebugMessageList result() const;
+
+private Q_SLOTS:
+ TP_QT_NO_EXPORT void watcherFinished(QDBusPendingCallWatcher*);
+
+private:
+ struct Private;
+ friend struct Private;
+
+ Private *mPriv;
+};
+
+}
+
+#endif
More information about the telepathy-commits
mailing list