telepathy-qt: dbus-tubes: Don't emit the busNamesChanged signal if we' re just handling property construction for a late-enabled feature
Dario Freddi
drf at kemper.freedesktop.org
Tue Jul 3 15:08:45 PDT 2012
Module: telepathy-qt
Branch: master
Commit: 901d48eeb6592890866721c984cec2ccce1f5197
URL: http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=901d48eeb6592890866721c984cec2ccce1f5197
Author: Dario Freddi <dario.freddi at collabora.com>
Date: Thu Nov 10 23:58:09 2011 +0100
dbus-tubes: Don't emit the busNamesChanged signal if we're just handling property construction for a late-enabled feature
---
TelepathyQt/dbus-tube-channel.cpp | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/TelepathyQt/dbus-tube-channel.cpp b/TelepathyQt/dbus-tube-channel.cpp
index ec6072a..1413e23 100644
--- a/TelepathyQt/dbus-tube-channel.cpp
+++ b/TelepathyQt/dbus-tube-channel.cpp
@@ -370,12 +370,12 @@ void DBusTubeChannel::onRequestPropertyDBusNamesFinished(PendingOperation *op)
// Nothing to do actually, simply mark the feature as ready.
mPriv->readinessHelper->setIntrospectCompleted(DBusTubeChannel::FeatureBusNameMonitoring, true);
} else {
- // Extract the participants, populating the QueuedContactFactory
- mPriv->extractParticipants(participants);
-
// Wait for the queue to complete
connect(mPriv->queuedContactFactory, SIGNAL(queueCompleted()),
this, SLOT(onQueueCompleted()));
+
+ // Extract the participants, populating the QueuedContactFactory
+ mPriv->extractParticipants(participants);
}
} else {
warning().nospace() << "RequestPropertyDBusNames failed "
@@ -386,6 +386,8 @@ void DBusTubeChannel::onRequestPropertyDBusNamesFinished(PendingOperation *op)
void DBusTubeChannel::onQueueCompleted()
{
+ debug() << "Queue was completed";
+
// Set the feature as completed, and disconnect the signal as it's no longer useful
mPriv->readinessHelper->setIntrospectCompleted(DBusTubeChannel::FeatureBusNameMonitoring, true);
@@ -424,8 +426,10 @@ void DBusTubeChannel::onContactsRetrieved(const QUuid &uuid, const QList<Contact
added.insert(contact, busName);
}
- // Time for us to emit the signal
- emit busNamesChanged(added, QList<ContactPtr>());
+ // Time for us to emit the signal - if the feature is ready
+ if (isReady(FeatureBusNameMonitoring)) {
+ emit busNamesChanged(added, QList<ContactPtr>());
+ }
} else if (mPriv->pendingNewBusNamesToRemove.contains(uuid)) {
mPriv->pendingNewBusNamesToRemove.removeOne(uuid);
QList<ContactPtr> removed;
@@ -441,8 +445,10 @@ void DBusTubeChannel::onContactsRetrieved(const QUuid &uuid, const QList<Contact
}
}
- // Time for us to emit the signal
- emit busNamesChanged(QHash<ContactPtr, QString>(), removed);
+ // Time for us to emit the signal - if the feature is ready
+ if (isReady(FeatureBusNameMonitoring)) {
+ emit busNamesChanged(QHash<ContactPtr, QString>(), removed);
+ }
} else {
warning() << "Contacts retrieved but no pending bus names were found";
return;
More information about the telepathy-commits
mailing list