[Telepathy-commits] [telepathy-qt4/master] Bump tp-glib dependency to 0.7.28.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Wed Mar 25 07:02:13 PDT 2009


Fixed connection and tests now that PendingHandles do not finish with error when
the error is non-critical (fixed on 0.7.28).
---
 TelepathyQt4/Client/connection.cpp |   12 ++++++------
 configure.ac                       |    2 +-
 tests/dbus/contacts.cpp            |   26 +++++++++++---------------
 3 files changed, 18 insertions(+), 22 deletions(-)

diff --git a/TelepathyQt4/Client/connection.cpp b/TelepathyQt4/Client/connection.cpp
index 93ce159..efabe14 100644
--- a/TelepathyQt4/Client/connection.cpp
+++ b/TelepathyQt4/Client/connection.cpp
@@ -947,12 +947,12 @@ void Connection::gotContactListsHandles(PendingOperation *op)
     debug() << "Got handles for contact lists";
     PendingHandles *pending = qobject_cast<PendingHandles*>(op);
 
-    // FIXME check for handles in pending->invalidHandles() when
-    //       invalidHandles is implemented
-    // if (pending->invalidHandles().size() == 1) {
-    //     contactListChannelReady();
-    //     return;
-    // }
+    if (pending->invalidNames().size() == 1) {
+        // let's not fail, because the contact lists are not supported
+        debug() << "Unable to retrieve contact list handle, ignoring";
+        contactListChannelReady();
+        return;
+    }
 
     debug() << "Requesting channels for contact lists";
     QVariantMap request;
diff --git a/configure.ac b/configure.ac
index 79057c8..a156f37 100644
--- a/configure.ac
+++ b/configure.ac
@@ -182,7 +182,7 @@ AC_SUBST(PROTO_CFLAGS)
 
 dnl Check for telepathy-glib, and for Qt <-> GLib main loop integration:
 dnl if we have both, we can run more tests
-PKG_CHECK_MODULES(TP_GLIB, [telepathy-glib >= 0.7.27], [have_tp_glib=yes],
+PKG_CHECK_MODULES(TP_GLIB, [telepathy-glib >= 0.7.28], [have_tp_glib=yes],
                   [have_tp_glib=no])
 AC_SUBST(TP_GLIB_CFLAGS)
 AC_SUBST(TP_GLIB_LIBS)
diff --git a/tests/dbus/contacts.cpp b/tests/dbus/contacts.cpp
index 38139f0..986d7d0 100644
--- a/tests/dbus/contacts.cpp
+++ b/tests/dbus/contacts.cpp
@@ -340,27 +340,23 @@ void TestContacts::testForIdentifiers()
     QVERIFY(connect(fails,
                 SIGNAL(finished(Telepathy::Client::PendingOperation*)),
                 SLOT(expectSuccessfulCall(Telepathy::Client::PendingOperation*))));
-    // FIXME replace this when spec is fixed, Error.NotAvailable should be Errors.NotAvailable
-    QCOMPARE(mLoop->exec(), 1);
-    // QCOMPARE(mLoop->exec(), 0);
-    // QStringList toCheck = fails->invalidIdentifiers().keys();
-    // toCheck.sort();
-    // invalidIDs.sort();
-    // QCOMPARE(toCheck, invalidIDs);
+    QCOMPARE(mLoop->exec(), 0);
+    toCheck = fails->invalidIdentifiers().keys();
+    toCheck.sort();
+    invalidIDs.sort();
+    QCOMPARE(toCheck, invalidIDs);
 
     // A request with both valid and invalid IDs should succeed
     fails = mConn->contactManager()->contactsForIdentifiers(invalidIDs + validIDs + invalidIDs);
     QVERIFY(connect(fails,
                 SIGNAL(finished(Telepathy::Client::PendingOperation*)),
                 SLOT(expectSuccessfulCall(Telepathy::Client::PendingOperation*))));
-    // FIXME replace this when spec is fixed, Error.NotAvailable should be Errors.NotAvailable
-    QCOMPARE(mLoop->exec(), 1);
-    // QCOMPARE(mLoop->exec(), 0);
-    // QCOMPARE(fails->validIdentifiers(), validIDs);
-    // toCheck = fails->invalidIdentifiers().keys();
-    // toCheck.sort();
-    // invalidIDs.sort();
-    // QCOMPARE(toCheck, invalidIDs);
+    QCOMPARE(mLoop->exec(), 0);
+    QCOMPARE(fails->validIdentifiers(), validIDs);
+    toCheck = fails->invalidIdentifiers().keys();
+    toCheck.sort();
+    invalidIDs.sort();
+    QCOMPARE(toCheck, invalidIDs);
 
     // Go on to the meat: valid IDs
     PendingContacts *pending = mConn->contactManager()->contactsForIdentifiers(validIDs);
-- 
1.5.6.5




More information about the telepathy-commits mailing list