[Telepathy-commits] [telepathy-qt4/master] Connection: Added FeatureCore.
Andre Moreira Magalhaes (andrunko)
andre.magalhaes at collabora.co.uk
Mon Feb 23 10:22:34 PST 2009
---
TelepathyQt4/Client/connection.cpp | 19 +++++++++++--------
TelepathyQt4/Client/connection.h | 1 +
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/TelepathyQt4/Client/connection.cpp b/TelepathyQt4/Client/connection.cpp
index ff55c35..c457f26 100644
--- a/TelepathyQt4/Client/connection.cpp
+++ b/TelepathyQt4/Client/connection.cpp
@@ -173,11 +173,11 @@ Connection::Private::Private(Connection *parent)
QStringList(), // dependsOnInterfaces
(ReadinessHelper::IntrospectFunc) &Private::introspectMain,
this);
- introspectables[0] = introspectableCore;
+ introspectables[FeatureCore] = introspectableCore;
ReadinessHelper::Introspectable introspectableSelfContact(
QSet<uint>() << Connection::StatusConnected, // makesSenseForStatuses
- QSet<uint>() << 0, // dependsOnFeatures (core)
+ QSet<uint>() << FeatureCore, // dependsOnFeatures (core)
QStringList() << TELEPATHY_INTERFACE_CONNECTION_INTERFACE_CONTACTS, // dependsOnInterfaces
(ReadinessHelper::IntrospectFunc) &Private::introspectSelfContact,
this);
@@ -185,7 +185,7 @@ Connection::Private::Private(Connection *parent)
ReadinessHelper::Introspectable introspectableSimplePresence(
QSet<uint>() << Connection::StatusConnected, // makesSenseForStatuses
- QSet<uint>() << 0, // dependsOnFeatures (core)
+ QSet<uint>() << FeatureCore, // dependsOnFeatures (core)
QStringList() << TELEPATHY_INTERFACE_CONNECTION_INTERFACE_SIMPLE_PRESENCE, // dependsOnInterfaces
(ReadinessHelper::IntrospectFunc) &Private::introspectSimplePresence,
this);
@@ -768,7 +768,7 @@ void Connection::gotStatus(QDBusPendingCallWatcher *watcher)
invalidate(reply.error());
// introspect core failed
- mPriv->readinessHelper->setIntrospectCompleted(0, false);
+ mPriv->readinessHelper->setIntrospectCompleted(FeatureCore, false);
return;
}
@@ -800,7 +800,7 @@ void Connection::gotInterfaces(QDBusPendingCallWatcher *watcher)
if (mPriv->pendingStatus == StatusConnected) {
mPriv->introspectSelfHandle();
} else {
- mPriv->readinessHelper->setIntrospectCompleted(0, true);
+ mPriv->readinessHelper->setIntrospectCompleted(FeatureCore, true);
}
watcher->deleteLater();
@@ -822,7 +822,7 @@ void Connection::gotContactAttributeInterfaces(QDBusPendingCallWatcher *watcher)
"can't be retrieved";
}
- mPriv->readinessHelper->setIntrospectCompleted(0, true);
+ mPriv->readinessHelper->setIntrospectCompleted(FeatureCore, true);
watcher->deleteLater();
}
@@ -886,12 +886,12 @@ void Connection::gotSelfHandle(QDBusPendingCallWatcher *watcher)
if (mPriv->interfaces.contains(TELEPATHY_INTERFACE_CONNECTION_INTERFACE_CONTACTS)) {
mPriv->introspectContacts();
} else {
- mPriv->readinessHelper->setIntrospectCompleted(0, true);
+ mPriv->readinessHelper->setIntrospectCompleted(FeatureCore, true);
}
} else {
warning().nospace() << "Getting self handle failed with " <<
reply.error().name() << ":" << reply.error().message();
- mPriv->readinessHelper->setIntrospectCompleted(0, false);
+ mPriv->readinessHelper->setIntrospectCompleted(FeatureCore, false);
}
watcher->deleteLater();
@@ -1153,6 +1153,9 @@ bool Connection::isReady(const QSet<uint> &features) const
* its initial setup, or will fail if a fatal error occurs during this
* initial setup.
*
+ * If an empty set is used FeatureCore will be considered as the requested
+ * feature.
+ *
* \param requestedFeatures Which features should be tested.
* \return A PendingReady object which will emit finished
* when this object has finished or failed its initial setup.
diff --git a/TelepathyQt4/Client/connection.h b/TelepathyQt4/Client/connection.h
index 0277ca2..87f3d2f 100644
--- a/TelepathyQt4/Client/connection.h
+++ b/TelepathyQt4/Client/connection.h
@@ -63,6 +63,7 @@ class Connection : public StatefulDBusProxy,
public:
enum Feature {
+ FeatureCore = 0,
FeatureSelfContact = 1,
FeatureSimplePresence = 2,
_Padding = 0xFFFFFFFF
--
1.5.6.5
More information about the telepathy-commits
mailing list