diff options
author | Andre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk> | 2011-09-28 15:46:27 -0300 |
---|---|---|
committer | Andre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk> | 2011-09-29 10:18:34 -0300 |
commit | e2e96874cf73f9698a54195ffadef95158457f30 (patch) | |
tree | b47ca9ad70a17f8d7291994d2afaa19c536df222 | |
parent | 3ea14ddcaba72282009a96b2a33e3944eb3bdb18 (diff) |
Contact: Use ContactManager::requestContactInfo() on requestInfo().
-rw-r--r-- | TelepathyQt4/contact.cpp | 19 | ||||
-rw-r--r-- | tests/dbus/contacts-info.cpp | 2 |
2 files changed, 5 insertions, 16 deletions
diff --git a/TelepathyQt4/contact.cpp b/TelepathyQt4/contact.cpp index 89d4dffd..c3d7021c 100644 --- a/TelepathyQt4/contact.cpp +++ b/TelepathyQt4/contact.cpp @@ -621,28 +621,17 @@ Contact::InfoFields Contact::infoFields() const */ PendingOperation *Contact::refreshInfo() { - if (!mPriv->requestedFeatures.contains(FeatureInfo)) { + ConnectionPtr conn = manager()->connection(); + if (!mPriv->requestedFeatures.contains(FeatureInfo)) { warning() << "Contact::refreshInfo() used on" << this << "for which FeatureInfo hasn't been requested - failing"; return new PendingFailure(QLatin1String(TELEPATHY_ERROR_NOT_AVAILABLE), QLatin1String("FeatureInfo needs to be ready in order to " "use this method"), - ContactPtr(this)); - } - - ConnectionPtr connection = manager()->connection(); - if (!connection->hasInterface(TP_QT4_IFACE_CONNECTION_INTERFACE_CONTACT_INFO)) { - return new PendingFailure(QLatin1String(TELEPATHY_ERROR_NOT_IMPLEMENTED), - QLatin1String("Connection does not support ContactInfo interface"), - ContactPtr(this)); + conn); } - Client::ConnectionInterfaceContactInfoInterface *contactInfoInterface = - connection->interface<Client::ConnectionInterfaceContactInfoInterface>(); - return new PendingVoid( - contactInfoInterface->RefreshContactInfo( - UIntList() << mPriv->handle[0]), - ContactPtr(this)); + return manager()->refreshContactInfo(this); } /** diff --git a/tests/dbus/contacts-info.cpp b/tests/dbus/contacts-info.cpp index b18fa387..a14c27c2 100644 --- a/tests/dbus/contacts-info.cpp +++ b/tests/dbus/contacts-info.cpp @@ -178,7 +178,7 @@ void TestContactsInfo::testInfo() QCOMPARE(mContactsInfoFieldsUpdated, contacts.size()); - QCOMPARE(serviceConn->refresh_contact_info_called, static_cast<uint>(contacts.size())); + QCOMPARE(serviceConn->refresh_contact_info_called, static_cast<uint>(1)); for (int i = 0; i < contacts.size(); i++) { ContactPtr contact = contacts[i]; |