telepathy-qt: dbus-tubes: Move methods implementations in the right position

Dario Freddi drf at kemper.freedesktop.org
Tue Jul 3 15:08:39 PDT 2012


Module: telepathy-qt
Branch: master
Commit: 1c7624b633a34200428d80cd6f27cf2c28f1b5c1
URL:    http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=1c7624b633a34200428d80cd6f27cf2c28f1b5c1

Author: Dario Freddi <dario.freddi at collabora.co.uk>
Date:   Tue Mar 15 18:22:25 2011 +0100

dbus-tubes: Move methods implementations in the right position

---

 TelepathyQt/dbus-tube-channel.cpp        |   89 +++++++++++++++---------------
 TelepathyQt/pending-dbus-tube-accept.cpp |   28 +++++-----
 TelepathyQt/pending-dbus-tube-offer.cpp  |   28 +++++-----
 3 files changed, 72 insertions(+), 73 deletions(-)

diff --git a/TelepathyQt/dbus-tube-channel.cpp b/TelepathyQt/dbus-tube-channel.cpp
index fb7b110..dda607a 100644
--- a/TelepathyQt/dbus-tube-channel.cpp
+++ b/TelepathyQt/dbus-tube-channel.cpp
@@ -80,51 +80,6 @@ void DBusTubeChannel::Private::extractParticipants(const Tp::DBusTubeParticipant
     }
 }
 
-
-void DBusTubeChannel::gotDBusTubeProperties(QDBusPendingCallWatcher *watcher)
-{
-    QDBusPendingReply<QVariantMap> reply = *watcher;
-
-    if (!reply.isError()) {
-        QVariantMap props = reply.value();
-        mPriv->extractProperties(props);
-        debug() << "Got reply to Properties::GetAll(DBusTubeChannel)";
-        mPriv->readinessHelper->setIntrospectCompleted(DBusTubeChannel::FeatureDBusTube, true);
-    } else {
-        warning().nospace() << "Properties::GetAll(DBusTubeChannel) failed "
-            "with " << reply.error().name() << ": " << reply.error().message();
-        mPriv->readinessHelper->setIntrospectCompleted(DBusTubeChannel::FeatureDBusTube, false,
-                reply.error());
-    }
-}
-
-void DBusTubeChannel::onDBusNamesChanged(
-        const Tp::DBusTubeParticipants &added,
-        const Tp::UIntList &removed)
-{
-    QHash<ContactPtr, QString> realAdded;
-    QList<ContactPtr> realRemoved;
-
-    for (DBusTubeParticipants::const_iterator i = added.constBegin();
-         i != added.constEnd();
-         ++i) {
-        ContactPtr contact = connection()->contactManager()->lookupContactByHandle(i.key());
-        realAdded.insert(contact, i.value());
-        // Add it to our hash as well
-        mPriv->busNames.insert(contact, i.value());
-    }
-
-    foreach (uint handle, removed) {
-        ContactPtr contact = connection()->contactManager()->lookupContactByHandle(handle);
-        realRemoved << contact;
-        // Remove it from our hash as well
-        mPriv->busNames.remove(contact);
-    }
-
-    // Emit the "real" signal
-    emit busNamesChanged(realAdded, realRemoved);
-}
-
 void DBusTubeChannel::Private::introspectBusNamesMonitoring(
         DBusTubeChannel::Private *self)
 {
@@ -344,6 +299,50 @@ QHash< ContactPtr, QString > DBusTubeChannel::busNames() const
     return mPriv->busNames;
 }
 
+void DBusTubeChannel::gotDBusTubeProperties(QDBusPendingCallWatcher *watcher)
+{
+    QDBusPendingReply<QVariantMap> reply = *watcher;
+
+    if (!reply.isError()) {
+        QVariantMap props = reply.value();
+        mPriv->extractProperties(props);
+        debug() << "Got reply to Properties::GetAll(DBusTubeChannel)";
+        mPriv->readinessHelper->setIntrospectCompleted(DBusTubeChannel::FeatureDBusTube, true);
+    } else {
+        warning().nospace() << "Properties::GetAll(DBusTubeChannel) failed "
+            "with " << reply.error().name() << ": " << reply.error().message();
+        mPriv->readinessHelper->setIntrospectCompleted(DBusTubeChannel::FeatureDBusTube, false,
+                reply.error());
+    }
+}
+
+void DBusTubeChannel::onDBusNamesChanged(
+        const Tp::DBusTubeParticipants &added,
+        const Tp::UIntList &removed)
+{
+    QHash<ContactPtr, QString> realAdded;
+    QList<ContactPtr> realRemoved;
+
+    for (DBusTubeParticipants::const_iterator i = added.constBegin();
+         i != added.constEnd();
+         ++i) {
+        ContactPtr contact = connection()->contactManager()->lookupContactByHandle(i.key());
+        realAdded.insert(contact, i.value());
+        // Add it to our hash as well
+        mPriv->busNames.insert(contact, i.value());
+    }
+
+    foreach (uint handle, removed) {
+        ContactPtr contact = connection()->contactManager()->lookupContactByHandle(handle);
+        realRemoved << contact;
+        // Remove it from our hash as well
+        mPriv->busNames.remove(contact);
+    }
+
+    // Emit the "real" signal
+    emit busNamesChanged(realAdded, realRemoved);
+}
+
 // Signals documentation
 /**
  * \fn void DBusTubeChannel::busNamesChanged(const QHash< ContactPtr, QString > &added, const QList< ContactPtr > &removed)
diff --git a/TelepathyQt/pending-dbus-tube-accept.cpp b/TelepathyQt/pending-dbus-tube-accept.cpp
index 788f50a..fdb50a8 100644
--- a/TelepathyQt/pending-dbus-tube-accept.cpp
+++ b/TelepathyQt/pending-dbus-tube-accept.cpp
@@ -96,6 +96,20 @@ PendingDBusTubeAccept::~PendingDBusTubeAccept()
     delete mPriv;
 }
 
+/**
+ * When the operation has been completed successfully, returns the address of the opened DBus connection.
+ *
+ * Please note this function will return a meaningful value only if the operation has already
+ * been completed successfully: in case of failure or non-completion, an empty QString will be
+ * returned.
+ *
+ * \returns The address of the opened DBus connection.
+ */
+QString PendingDBusTubeAccept::address() const
+{
+    return mPriv->tube->address();
+}
+
 void PendingDBusTubeAccept::onAcceptFinished(PendingOperation *op)
 {
     if (op->isError()) {
@@ -133,18 +147,4 @@ void PendingDBusTubeAccept::onTubeStateChanged(TubeChannelState state)
     }
 }
 
-/**
- * When the operation has been completed successfully, returns the address of the opened DBus connection.
- *
- * Please note this function will return a meaningful value only if the operation has already
- * been completed successfully: in case of failure or non-completion, an empty QString will be
- * returned.
- *
- * \returns The address of the opened DBus connection.
- */
-QString PendingDBusTubeAccept::address() const
-{
-    return mPriv->tube->address();
-}
-
 }
diff --git a/TelepathyQt/pending-dbus-tube-offer.cpp b/TelepathyQt/pending-dbus-tube-offer.cpp
index 7becfa8..ed2e96b 100644
--- a/TelepathyQt/pending-dbus-tube-offer.cpp
+++ b/TelepathyQt/pending-dbus-tube-offer.cpp
@@ -97,6 +97,20 @@ PendingDBusTubeOffer::~PendingDBusTubeOffer()
     delete mPriv;
 }
 
+/**
+ * When the operation has been completed successfully, returns the address of the opened DBus connection.
+ *
+ * Please note this function will return a meaningful value only if the operation has already
+ * been completed successfully: in case of failure or non-completion, an empty QString will be
+ * returned.
+ *
+ * \returns The address of the opened DBus connection.
+ */
+QString PendingDBusTubeOffer::address() const
+{
+    return mPriv->tube->address();
+}
+
 void PendingDBusTubeOffer::onOfferFinished(PendingOperation *op)
 {
     if (op->isError()) {
@@ -134,18 +148,4 @@ void PendingDBusTubeOffer::onTubeStateChanged(TubeChannelState state)
     }
 }
 
-/**
- * When the operation has been completed successfully, returns the address of the opened DBus connection.
- *
- * Please note this function will return a meaningful value only if the operation has already
- * been completed successfully: in case of failure or non-completion, an empty QString will be
- * returned.
- *
- * \returns The address of the opened DBus connection.
- */
-QString PendingDBusTubeOffer::address() const
-{
-    return mPriv->tube->address();
-}
-
 }



More information about the telepathy-commits mailing list