equal
deleted
inserted
replaced
24 #include "logseventdata.h" |
24 #include "logseventdata.h" |
25 #include "qtcontacts_stubs_helper.h" |
25 #include "qtcontacts_stubs_helper.h" |
26 #include "logsdbconnector_stub_helper.h" |
26 #include "logsdbconnector_stub_helper.h" |
27 #include <hblineedit.h> |
27 #include <hblineedit.h> |
28 #include <hbglobal.h> |
28 #include <hbglobal.h> |
|
29 #include <hbextendedlocale.h> |
29 #include <QtTest/QtTest> |
30 #include <QtTest/QtTest> |
30 |
31 |
31 Q_DECLARE_METATYPE(LogsCall *) |
32 Q_DECLARE_METATYPE(LogsCall *) |
32 Q_DECLARE_METATYPE(LogsMessage *) |
33 Q_DECLARE_METATYPE(LogsMessage *) |
33 Q_DECLARE_METATYPE(LogsContact *) |
34 Q_DECLARE_METATYPE(LogsContact *) |
113 QVERIFY( decoration.count() == 1 ); |
114 QVERIFY( decoration.count() == 1 ); |
114 |
115 |
115 // Test date and time |
116 // Test date and time |
116 display = mModel->data(mModel->index(1), Qt::DisplayRole).toStringList(); |
117 display = mModel->data(mModel->index(1), Qt::DisplayRole).toStringList(); |
117 QVERIFY( display.count() == 2 ); |
118 QVERIFY( display.count() == 2 ); |
118 QVERIFY( display.at(1) == testDetailsDateAndTime.toTimeSpec(Qt::LocalTime).toString() ); |
119 QDateTime localTime = testDetailsDateAndTime.toTimeSpec(Qt::LocalTime); |
|
120 QVERIFY( display.at(1).startsWith( |
|
121 localTime.date().toString(Qt::SystemLocaleShortDate)) ); |
|
122 |
119 decoration = mModel->data(mModel->index(1), Qt::DecorationRole).toList(); |
123 decoration = mModel->data(mModel->index(1), Qt::DecorationRole).toList(); |
120 QVERIFY( decoration.count() == 1 ); |
124 QVERIFY( decoration.count() == 1 ); |
121 |
125 |
122 // Test call direction |
126 // Test call direction |
123 display = mModel->data(mModel->index(2), Qt::DisplayRole).toStringList(); |
127 display = mModel->data(mModel->index(2), Qt::DisplayRole).toStringList(); |
136 // Test call duration |
140 // Test call duration |
137 display = mModel->data(mModel->index(4), Qt::DisplayRole).toStringList(); |
141 display = mModel->data(mModel->index(4), Qt::DisplayRole).toStringList(); |
138 QVERIFY( display.count() == 2 ); |
142 QVERIFY( display.count() == 2 ); |
139 QTime n(0,0,0); |
143 QTime n(0,0,0); |
140 QTime t = n.addSecs(testDetailsDuration); |
144 QTime t = n.addSecs(testDetailsDuration); |
141 QVERIFY( display.at(1) == t.toString("hh:mm:ss") ); |
145 QChar timeSeparator = HbExtendedLocale::system().timeSeparator(1); |
|
146 QString tiemFormat = QString("hh%1mm%2ss").arg(timeSeparator).arg(timeSeparator); |
|
147 QCOMPARE( display.at(1), t.toString(tiemFormat)); |
142 decoration = mModel->data(mModel->index(4), Qt::DecorationRole).toList(); |
148 decoration = mModel->data(mModel->index(4), Qt::DecorationRole).toList(); |
143 QVERIFY( decoration.count() == 1 ); |
149 QVERIFY( decoration.count() == 1 ); |
144 |
150 |
145 // Test call, event type supports call |
151 // Test call, event type supports call |
146 QVariant callData = mModel->data(mModel->index(0), LogsDetailsModel::RoleCall); |
152 QVariant callData = mModel->data(mModel->index(0), LogsDetailsModel::RoleCall); |