diff options
author | Andre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk> | 2009-11-10 10:17:37 -0300 |
---|---|---|
committer | Andre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk> | 2009-11-10 10:17:40 -0300 |
commit | f07642b676c39ffbb584da34acacdacdbf0dfc69 (patch) | |
tree | 0f749acde6dcdcc977324f3bfe5b921cc797fa65 | |
parent | 0b425125372ededf6eb34bdeed7995694a2b27db (diff) | |
parent | 33c459b8726f640e4830887f108b878f1c1cdee5 (diff) |
Merge branch 'connection'
Reviewed-by: Simon McVittie (smcv) <simon.mcvittie@collabora.co.uk>
-rw-r--r-- | TelepathyQt4/connection.cpp | 23 | ||||
-rw-r--r-- | TelepathyQt4/connection.h | 9 | ||||
-rw-r--r-- | TelepathyQt4/pending-contact-attributes.cpp | 4 | ||||
-rw-r--r-- | TelepathyQt4/pending-contacts.cpp | 2 | ||||
-rw-r--r-- | tests/dbus/chan-basics.cpp | 15 | ||||
-rw-r--r-- | tests/dbus/chan-group.cpp | 15 | ||||
-rw-r--r-- | tests/dbus/conn-basics.cpp | 15 | ||||
-rw-r--r-- | tests/dbus/conn-capabilities.cpp | 2 | ||||
-rw-r--r-- | tests/dbus/conn-requests.cpp | 2 | ||||
-rw-r--r-- | tests/dbus/conn-roster-groups.cpp | 3 | ||||
-rw-r--r-- | tests/dbus/conn-roster.cpp | 2 | ||||
-rw-r--r-- | tests/dbus/contacts-capabilities.cpp | 2 | ||||
-rw-r--r-- | tests/dbus/contacts.cpp | 15 | ||||
-rw-r--r-- | tests/dbus/handles.cpp | 15 |
14 files changed, 65 insertions, 59 deletions
diff --git a/TelepathyQt4/connection.cpp b/TelepathyQt4/connection.cpp index 752ea623..84cb3c2c 100644 --- a/TelepathyQt4/connection.cpp +++ b/TelepathyQt4/connection.cpp @@ -594,22 +594,22 @@ Connection::~Connection() * The returned value may have changed whenever statusChanged() is * emitted. * - * \return The status, as defined in Status. + * \return The status, as defined in Connection::Status. */ -uint Connection::status() const +Connection::Status Connection::status() const { - return mPriv->status; + return (Connection::Status) mPriv->status; } /** * Return the reason for the connection's status (which is returned by * status()). The validity and change rules are the same as for status(). * - * \return The reason, as defined in Status. + * \return The reason, as defined in ConnectionStatusReason. */ -uint Connection::statusReason() const +ConnectionStatusReason Connection::statusReason() const { - return mPriv->statusReason; + return (ConnectionStatusReason) mPriv->statusReason; } /** @@ -806,7 +806,8 @@ void Connection::onStatusReady(uint status) mPriv->status = status; mPriv->statusReason = mPriv->pendingStatusReason; - emit statusChanged(mPriv->status, mPriv->statusReason); + emit statusChanged((Connection::Status) mPriv->status, + (ConnectionStatusReason) mPriv->statusReason); } void Connection::onStatusChanged(uint status, uint reason) @@ -1508,7 +1509,7 @@ PendingOperation *Connection::requestDisconnect() * \return Pointer to a newly constructed PendingContactAttributes, tracking the progress of the * request. */ -PendingContactAttributes *Connection::getContactAttributes(const UIntList &handles, +PendingContactAttributes *Connection::contactAttributes(const UIntList &handles, const QStringList &interfaces, bool reference) { debug() << "Request for attributes for" << handles.size() << "contacts"; @@ -1517,16 +1518,16 @@ PendingContactAttributes *Connection::getContactAttributes(const UIntList &handl new PendingContactAttributes(ConnectionPtr(this), handles, interfaces, reference); if (!isReady()) { - warning() << "Connection::getContactAttributes() used when not ready"; + warning() << "Connection::contactAttributes() used when not ready"; pending->failImmediately(TELEPATHY_ERROR_NOT_AVAILABLE, "The connection isn't ready"); return pending; } /* FIXME: readd this check when Connection isn't FSCKING broken anymore: else if (status() != StatusConnected) { - warning() << "Connection::getContactAttributes() used with status" << status() << "!= StatusConnected"; + warning() << "Connection::contactAttributes() used with status" << status() << "!= StatusConnected"; pending->failImmediately(TELEPATHY_ERROR_NOT_AVAILABLE, "The connection isn't Connected"); return pending; } */else if (!this->interfaces().contains(TELEPATHY_INTERFACE_CONNECTION_INTERFACE_CONTACTS)) { - warning() << "Connection::getContactAttributes() used without the remote object supporting" + warning() << "Connection::contactAttributes() used without the remote object supporting" << "the Contacts interface"; pending->failImmediately(TELEPATHY_ERROR_NOT_IMPLEMENTED, "The connection doesn't support the Contacts interface"); diff --git a/TelepathyQt4/connection.h b/TelepathyQt4/connection.h index 1cfae648..c188d287 100644 --- a/TelepathyQt4/connection.h +++ b/TelepathyQt4/connection.h @@ -87,8 +87,8 @@ public: virtual ~Connection(); - uint status() const; - uint statusReason() const; + Status status() const; + ConnectionStatusReason statusReason() const; uint selfHandle() const; ContactPtr selfContact() const; @@ -107,7 +107,7 @@ public: PendingHandles *requestHandles(uint handleType, const QStringList &names); PendingHandles *referenceHandles(uint handleType, const UIntList &handles); - PendingContactAttributes *getContactAttributes(const UIntList &handles, + PendingContactAttributes *contactAttributes(const UIntList &handles, const QStringList &interfaces, bool reference = true); QStringList contactAttributeInterfaces() const; ContactManager *contactManager() const; @@ -160,7 +160,8 @@ public: } Q_SIGNALS: - void statusChanged(uint newStatus, uint newStatusReason); + void statusChanged(Tp::Connection::Status newStatus, + Tp::ConnectionStatusReason newStatusReason); void selfHandleChanged(uint newHandle); // FIXME: might not need this when Renaming is fixed and mapped to Contacts void selfContactChanged(); diff --git a/TelepathyQt4/pending-contact-attributes.cpp b/TelepathyQt4/pending-contact-attributes.cpp index b1d032ad..62a9bb66 100644 --- a/TelepathyQt4/pending-contact-attributes.cpp +++ b/TelepathyQt4/pending-contact-attributes.cpp @@ -56,7 +56,7 @@ namespace Tp * \headerfile <TelepathyQt4/pending-contact-attributes.h> <TelepathyQt4/PendingContactAttributes> * * Class containing the parameters of and the reply to an asynchronous request for raw contact - * attributes, as used in the Connection::getContactAttributes() low-level convenience method + * attributes, as used in the Connection::contactAttributes() low-level convenience method * wrapping the ConnectionInterfaceContactsInterface::GetContactAttributes() D-Bus method. */ @@ -125,7 +125,7 @@ const QStringList &PendingContactAttributes::interfacesRequested() const /** * Returns whether it was requested that the contact handles should be referenced in addition to * fetching their attributes. This corresponds to the <code>reference</code> argument to - * Connection::getContactAttributes(). + * Connection::contactAttributes(). * * \return Whether the handles should be referenced or not. */ diff --git a/TelepathyQt4/pending-contacts.cpp b/TelepathyQt4/pending-contacts.cpp index 6e14583e..7b602b62 100644 --- a/TelepathyQt4/pending-contacts.cpp +++ b/TelepathyQt4/pending-contacts.cpp @@ -363,7 +363,7 @@ PendingContacts::PendingContacts(ContactManager *manager, if (conn->interfaces().contains(TELEPATHY_INTERFACE_CONNECTION_INTERFACE_CONTACTS)) { debug() << " Building contacts using contact attributes"; PendingContactAttributes *attributes = - conn->getContactAttributes(otherContacts.toList(), + conn->contactAttributes(otherContacts.toList(), interfaces, true); connect(attributes, diff --git a/tests/dbus/chan-basics.cpp b/tests/dbus/chan-basics.cpp index 879e06f3..6f36c95d 100644 --- a/tests/dbus/chan-basics.cpp +++ b/tests/dbus/chan-basics.cpp @@ -30,7 +30,7 @@ public: { } protected Q_SLOTS: - void expectConnReady(uint, uint); + void expectConnReady(Tp::Connection::Status, Tp::ConnectionStatusReason); void expectConnInvalidated(); void expectPendingHandleFinished(Tp::PendingOperation*); void expectCreateChannelFinished(Tp::PendingOperation *); @@ -56,7 +56,8 @@ private: uint mHandle; }; -void TestChanBasics::expectConnReady(uint newStatus, uint newStatusReason) +void TestChanBasics::expectConnReady(Tp::Connection::Status newStatus, + Tp::ConnectionStatusReason newStatusReason) { qDebug() << "connection changed to status" << newStatus; switch (newStatus) { @@ -212,14 +213,14 @@ void TestChanBasics::initTestCase() if (mConn->status() != Connection::StatusConnected) { QVERIFY(connect(mConn.data(), - SIGNAL(statusChanged(uint, uint)), - SLOT(expectConnReady(uint, uint)))); + SIGNAL(statusChanged(Tp::Connection::Status, Tp::ConnectionStatusReason)), + SLOT(expectConnReady(Tp::Connection::Status, Tp::ConnectionStatusReason)))); QCOMPARE(mLoop->exec(), 0); QVERIFY(disconnect(mConn.data(), - SIGNAL(statusChanged(uint, uint)), + SIGNAL(statusChanged(Tp::Connection::Status, Tp::ConnectionStatusReason)), this, - SLOT(expectConnReady(uint, uint)))); - QCOMPARE(mConn->status(), (uint) Connection::StatusConnected); + SLOT(expectConnReady(Tp::Connection::Status, Tp::ConnectionStatusReason)))); + QCOMPARE(mConn->status(), Connection::StatusConnected); } QVERIFY(mConn->requestsInterface() != 0); diff --git a/tests/dbus/chan-group.cpp b/tests/dbus/chan-group.cpp index d8505ff2..097c661d 100644 --- a/tests/dbus/chan-group.cpp +++ b/tests/dbus/chan-group.cpp @@ -33,7 +33,7 @@ public: { } protected Q_SLOTS: - void expectConnReady(uint, uint); + void expectConnReady(Tp::Connection::Status, Tp::ConnectionStatusReason); void expectConnInvalidated(); void expectChanInvalidated(Tp::DBusProxy*,const QString &, const QString &); void expectPendingRoomHandlesFinished(Tp::PendingOperation*); @@ -87,7 +87,8 @@ private: QString mChanInvalidatedErrorMessage; }; -void TestChanGroup::expectConnReady(uint newStatus, uint newStatusReason) +void TestChanGroup::expectConnReady(Tp::Connection::Status newStatus, + Tp::ConnectionStatusReason newStatusReason) { qDebug() << "connection changed to status" << newStatus; switch (newStatus) { @@ -331,14 +332,14 @@ void TestChanGroup::initTestCase() if (mConn->status() != Connection::StatusConnected) { QVERIFY(connect(mConn.data(), - SIGNAL(statusChanged(uint, uint)), - SLOT(expectConnReady(uint, uint)))); + SIGNAL(statusChanged(Tp::Connection::Status, Tp::ConnectionStatusReason)), + SLOT(expectConnReady(Tp::Connection::Status, Tp::ConnectionStatusReason)))); QCOMPARE(mLoop->exec(), 0); QVERIFY(disconnect(mConn.data(), - SIGNAL(statusChanged(uint, uint)), + SIGNAL(statusChanged(Tp::Connection::Status, Tp::ConnectionStatusReason)), this, - SLOT(expectConnReady(uint, uint)))); - QCOMPARE(mConn->status(), (uint) Connection::StatusConnected); + SLOT(expectConnReady(Tp::Connection::Status, Tp::ConnectionStatusReason)))); + QCOMPARE(mConn->status(), Connection::StatusConnected); } QVERIFY(mConn->requestsInterface() != 0); diff --git a/tests/dbus/conn-basics.cpp b/tests/dbus/conn-basics.cpp index 947b82a1..f2c32f1f 100644 --- a/tests/dbus/conn-basics.cpp +++ b/tests/dbus/conn-basics.cpp @@ -27,7 +27,7 @@ public: { } protected Q_SLOTS: - void expectConnReady(uint, uint); + void expectConnReady(Tp::Connection::Status, Tp::ConnectionStatusReason); void expectConnInvalidated(); void expectPresenceAvailable(const Tp::SimplePresence &); @@ -46,7 +46,8 @@ private: ConnectionPtr mConn; }; -void TestConnBasics::expectConnReady(uint newStatus, uint newStatusReason) +void TestConnBasics::expectConnReady(Tp::Connection::Status newStatus, + Tp::ConnectionStatusReason newStatusReason) { qDebug() << "connection changed to status" << newStatus; switch (newStatus) { @@ -135,14 +136,14 @@ void TestConnBasics::init() if (mConn->status() != Connection::StatusConnected) { QVERIFY(connect(mConn.data(), - SIGNAL(statusChanged(uint, uint)), - SLOT(expectConnReady(uint, uint)))); + SIGNAL(statusChanged(Tp::Connection::Status, Tp::ConnectionStatusReason)), + SLOT(expectConnReady(Tp::Connection::Status, Tp::ConnectionStatusReason)))); QCOMPARE(mLoop->exec(), 0); QVERIFY(disconnect(mConn.data(), - SIGNAL(statusChanged(uint, uint)), + SIGNAL(statusChanged(Tp::Connection::Status, Tp::ConnectionStatusReason)), this, - SLOT(expectConnReady(uint, uint)))); - QCOMPARE(mConn->status(), (uint) Connection::StatusConnected); + SLOT(expectConnReady(Tp::Connection::Status, Tp::ConnectionStatusReason)))); + QCOMPARE(mConn->status(), Connection::StatusConnected); } } diff --git a/tests/dbus/conn-capabilities.cpp b/tests/dbus/conn-capabilities.cpp index b2227843..21374f25 100644 --- a/tests/dbus/conn-capabilities.cpp +++ b/tests/dbus/conn-capabilities.cpp @@ -89,7 +89,7 @@ void TestConnCapabilities::testCapabilities() SLOT(expectSuccessfulCall(Tp::PendingOperation*)))); QCOMPARE(mLoop->exec(), 0); QCOMPARE(mConn->isReady(), true); - QCOMPARE(mConn->status(), static_cast<uint>(Connection::StatusConnected)); + QCOMPARE(mConn->status(), Connection::StatusConnected); QVERIFY(mConn->requestsInterface() != 0); QVERIFY(mConn->capabilities() != 0); QCOMPARE(mConn->capabilities()->supportsTextChats(), true); diff --git a/tests/dbus/conn-requests.cpp b/tests/dbus/conn-requests.cpp index 71f9ce23..a5ac7fd1 100644 --- a/tests/dbus/conn-requests.cpp +++ b/tests/dbus/conn-requests.cpp @@ -182,7 +182,7 @@ void TestConnRequests::initTestCase() QCOMPARE(mLoop->exec(), 0); QCOMPARE(mConn->isReady(), true); - QCOMPARE(mConn->status(), static_cast<uint>(Connection::StatusConnected)); + QCOMPARE(mConn->status(), Connection::StatusConnected); QVERIFY(mConn->requestsInterface() != 0); } diff --git a/tests/dbus/conn-roster-groups.cpp b/tests/dbus/conn-roster-groups.cpp index 06c4a248..fb53dd66 100644 --- a/tests/dbus/conn-roster-groups.cpp +++ b/tests/dbus/conn-roster-groups.cpp @@ -129,8 +129,7 @@ void TestConnRosterGroups::init() SLOT(expectSuccessfulCall(Tp::PendingOperation*)))); QCOMPARE(mLoop->exec(), 0); QCOMPARE(mConn->isReady(), true); - QCOMPARE(mConn->status(), static_cast<uint>(Connection::StatusConnected)); - + QCOMPARE(mConn->status(), Connection::StatusConnected); } void TestConnRosterGroups::testRosterGroups() diff --git a/tests/dbus/conn-roster.cpp b/tests/dbus/conn-roster.cpp index 43433a50..830b9064 100644 --- a/tests/dbus/conn-roster.cpp +++ b/tests/dbus/conn-roster.cpp @@ -132,7 +132,7 @@ void TestConnRoster::init() SLOT(expectSuccessfulCall(Tp::PendingOperation*)))); QCOMPARE(mLoop->exec(), 0); QCOMPARE(mConn->isReady(), true); - QCOMPARE(mConn->status(), static_cast<uint>(Connection::StatusConnected)); + QCOMPARE(mConn->status(), Connection::StatusConnected); } void TestConnRoster::testRoster() diff --git a/tests/dbus/contacts-capabilities.cpp b/tests/dbus/contacts-capabilities.cpp index 11f042a6..f4f43554 100644 --- a/tests/dbus/contacts-capabilities.cpp +++ b/tests/dbus/contacts-capabilities.cpp @@ -114,7 +114,7 @@ void TestContactsCapabilities::initTestCase() QCOMPARE(mLoop->exec(), 0); QCOMPARE(mConn->isReady(), true); - QCOMPARE(mConn->status(), static_cast<uint>(Connection::StatusConnected)); + QCOMPARE(mConn->status(), Connection::StatusConnected); QVERIFY(mConn->contactManager()->supportedFeatures().contains(Contact::FeatureCapabilities)); } diff --git a/tests/dbus/contacts.cpp b/tests/dbus/contacts.cpp index 40f99e49..dcb8e44c 100644 --- a/tests/dbus/contacts.cpp +++ b/tests/dbus/contacts.cpp @@ -34,7 +34,7 @@ public: } protected Q_SLOTS: - void expectConnReady(uint newStatus, uint newStatusReason); + void expectConnReady(Tp::Connection::Status, Tp::ConnectionStatusReason); void expectConnInvalidated(); void expectPendingContactsFinished(Tp::PendingOperation *); @@ -62,7 +62,8 @@ private: Tp::UIntList mInvalidHandles; }; -void TestContacts::expectConnReady(uint newStatus, uint newStatusReason) +void TestContacts::expectConnReady(Tp::Connection::Status newStatus, + Tp::ConnectionStatusReason newStatusReason) { switch (newStatus) { case Connection::StatusDisconnected: @@ -167,14 +168,14 @@ void TestContacts::initTestCase() if (mConn->status() != Connection::StatusConnected) { QVERIFY(connect(mConn.data(), - SIGNAL(statusChanged(uint, uint)), - SLOT(expectConnReady(uint, uint)))); + SIGNAL(statusChanged(Tp::Connection::Status, Tp::ConnectionStatusReason)), + SLOT(expectConnReady(Tp::Connection::Status, Tp::ConnectionStatusReason)))); QCOMPARE(mLoop->exec(), 0); QVERIFY(disconnect(mConn.data(), - SIGNAL(statusChanged(uint, uint)), + SIGNAL(statusChanged(Tp::Connection::Status, Tp::ConnectionStatusReason)), this, - SLOT(expectConnReady(uint, uint)))); - QCOMPARE(mConn->status(), static_cast<uint>(Connection::StatusConnected)); + SLOT(expectConnReady(Tp::Connection::Status, Tp::ConnectionStatusReason)))); + QCOMPARE(mConn->status(), Connection::StatusConnected); } } diff --git a/tests/dbus/handles.cpp b/tests/dbus/handles.cpp index 8c885230..a5cd9ef5 100644 --- a/tests/dbus/handles.cpp +++ b/tests/dbus/handles.cpp @@ -29,7 +29,7 @@ public: { } protected Q_SLOTS: - void expectConnReady(uint newStatus, uint newStatusReason); + void expectConnReady(Tp::Connection::Status, Tp::ConnectionStatusReason); void expectConnInvalidated(); void expectPendingHandlesFinished(Tp::PendingOperation*); @@ -49,7 +49,8 @@ private: ReferencedHandles mHandles; }; -void TestHandles::expectConnReady(uint newStatus, uint newStatusReason) +void TestHandles::expectConnReady(Tp::Connection::Status newStatus, + Tp::ConnectionStatusReason newStatusReason) { switch (newStatus) { case Connection::StatusDisconnected: @@ -148,14 +149,14 @@ void TestHandles::initTestCase() if (mConn->status() != Connection::StatusConnected) { QVERIFY(connect(mConn.data(), - SIGNAL(statusChanged(uint, uint)), - SLOT(expectConnReady(uint, uint)))); + SIGNAL(statusChanged(Tp::Connection::Status, Tp::ConnectionStatusReason)), + SLOT(expectConnReady(Tp::Connection::Status, Tp::ConnectionStatusReason)))); QCOMPARE(mLoop->exec(), 0); QVERIFY(disconnect(mConn.data(), - SIGNAL(statusChanged(uint, uint)), + SIGNAL(statusChanged(Tp::Connection::Status, Tp::ConnectionStatusReason)), this, - SLOT(expectConnReady(uint, uint)))); - QCOMPARE(mConn->status(), (uint) Connection::StatusConnected); + SLOT(expectConnReady(Tp::Connection::Status, Tp::ConnectionStatusReason)))); + QCOMPARE(mConn->status(), Connection::StatusConnected); } } |