--- a/qtmobility/plugins/contacts/symbian/tsrc/tst_details/tst_details.cpp Fri Apr 16 15:51:22 2010 +0300
+++ b/qtmobility/plugins/contacts/symbian/tsrc/tst_details/tst_details.cpp Mon May 03 13:18:40 2010 +0300
@@ -40,7 +40,7 @@
****************************************************************************/
#include <QtTest/QtTest>
-
+#include <QDateTime>
#include "qtcontacts.h"
//TESTED_CLASS=
@@ -87,6 +87,7 @@
void testOrganisation();
void testPhoneNumber();
void testUrl();
+ void testPresence();
private slots:
@@ -104,9 +105,9 @@
{
qDebug() << "Contact: " << contact.localId();
QList<QContactDetail> details = contact.details();
- foreach(QContactDetail d, details) {
+ foreach(const QContactDetail& d, details) {
qDebug() << " " << d.definitionName() << ":";
- foreach( QString key, d.variantValues().keys() )
+ foreach( const QString& key, d.variantValues().keys() )
qDebug() << " " << key << d.variantValue(key);
}
}
@@ -114,7 +115,7 @@
void tst_details::initTestCase()
{
qDebug() << "Available managers:";
- foreach( QString manager, QContactManager::availableManagers() )
+ foreach( const QString& manager, QContactManager::availableManagers() )
qDebug() << manager;
QVERIFY(QContactManager::availableManagers().contains("symbian"));
@@ -400,5 +401,20 @@
saveAndVerifyContact( c );
}
+void tst_details::testPresence()
+{
+ QContact c;
+
+ QContactPresence presence;
+ presence.setNickname("Tom");
+ presence.setTimestamp(QDateTime::currentTime());
+ presence.setPresenceState(QContactPresence::PresenceAvailable);
+ presence.setPresenceStateText("Available");
+ presence.setPresenceStateImageUrl("http://example.com/example.jpg");
+ presence.setCustomMessage("MSN");
+ c.saveDetail(&presence);
+
+ saveAndVerifyContact( c );
+}
QTEST_MAIN(tst_details)
#include "tst_details.moc"