128 { |
128 { |
129 |
129 |
130 createContacts(); |
130 createContacts(); |
131 |
131 |
132 QContactDetailFilter df; |
132 QContactDetailFilter df; |
133 df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress ); |
133 df.setDetailDefinitionName(QContactEmailAddress::DefinitionName, QContactEmailAddress::FieldEmailAddress ); |
134 df.setMatchFlags( QContactFilter::MatchKeypadCollation ); |
134 df.setMatchFlags( QContactFilter::MatchKeypadCollation ); |
135 QContactLocalId cid; |
135 QContactLocalId cid; |
136 QContact contact; |
136 QContact contact; |
137 QContactName contactName; |
137 QContactName contactName; |
138 |
138 |
158 //search "s ya", contact (1) match |
158 //search "s ya", contact (1) match |
159 void ST_LogsCntFinderQwerty::testPredictiveEmailSearchWithSpace() |
159 void ST_LogsCntFinderQwerty::testPredictiveEmailSearchWithSpace() |
160 { |
160 { |
161 |
161 |
162 createContacts(); |
162 createContacts(); |
163 |
163 QContactDetailFilter df; |
164 QContactDetailFilter df; |
164 |
165 df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress ); |
165 df.setDetailDefinitionName(QContactEmailAddress::DefinitionName, QContactEmailAddress::FieldEmailAddress ); |
166 df.setMatchFlags( QContactFilter::MatchKeypadCollation ); |
166 df.setMatchFlags( QContactFilter::MatchKeypadCollation ); |
167 QContactLocalId cid; |
167 QContactLocalId cid; |
168 QContact contact; |
168 QContact contact; |
169 QContactName contactName; |
169 QContactName contactName; |
170 |
170 |
184 { |
184 { |
185 |
185 |
186 createContacts(); |
186 createContacts(); |
187 |
187 |
188 QContactDetailFilter df; |
188 QContactDetailFilter df; |
189 df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress ); |
189 df.setDetailDefinitionName(QContactEmailAddress::DefinitionName, QContactEmailAddress::FieldEmailAddress ); |
190 df.setMatchFlags( QContactFilter::MatchKeypadCollation ); |
190 df.setMatchFlags( QContactFilter::MatchKeypadCollation ); |
191 QContactLocalId cid; |
191 QContactLocalId cid; |
192 QContact contact; |
192 QContact contact; |
193 QContactName contactName; |
193 QContactName contactName; |
194 |
194 |
207 { |
207 { |
208 |
208 |
209 createContacts(); |
209 createContacts(); |
210 |
210 |
211 QContactDetailFilter df; |
211 QContactDetailFilter df; |
212 df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress ); |
212 df.setDetailDefinitionName(QContactEmailAddress::DefinitionName, QContactEmailAddress::FieldEmailAddress ); |
213 df.setMatchFlags( QContactFilter::MatchKeypadCollation ); |
213 df.setMatchFlags( QContactFilter::MatchKeypadCollation ); |
214 QContact contact; |
214 QContact contact; |
215 QContactName contactName; |
215 QContactName contactName; |
216 |
216 |
217 QString pattern = QString("pett") + QChar(30) + QString("vqwerty"); |
217 QString pattern = QString("pett") + QChar(30) + QString("vqwerty"); |
226 { |
226 { |
227 |
227 |
228 createContacts(); |
228 createContacts(); |
229 |
229 |
230 QContactDetailFilter df; |
230 QContactDetailFilter df; |
231 df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress ); |
231 df.setDetailDefinitionName(QContactEmailAddress::DefinitionName, QContactEmailAddress::FieldEmailAddress ); |
232 df.setMatchFlags( QContactFilter::MatchKeypadCollation ); |
232 df.setMatchFlags( QContactFilter::MatchKeypadCollation ); |
233 QContactLocalId cid; |
233 QContactLocalId cid; |
234 QContact contact; |
234 QContact contact; |
235 QContactName contactName; |
235 QContactName contactName; |
236 |
236 |
249 { |
249 { |
250 |
250 |
251 createContacts(); |
251 createContacts(); |
252 |
252 |
253 QContactDetailFilter df; |
253 QContactDetailFilter df; |
254 df.setDetailDefinitionName(QContactName::DefinitionName, QContactEmailAddress::FieldEmailAddress ); |
254 df.setDetailDefinitionName(QContactEmailAddress::DefinitionName, QContactEmailAddress::FieldEmailAddress ); |
255 df.setMatchFlags( QContactFilter::MatchKeypadCollation ); |
255 df.setMatchFlags( QContactFilter::MatchKeypadCollation ); |
256 QContactLocalId cid; |
256 QContactLocalId cid; |
257 QContact contact; |
257 QContact contact; |
258 QContactName contactName; |
258 QContactName contactName; |
259 |
259 |
267 contactName = contact.detail( QContactName::DefinitionName ); |
267 contactName = contact.detail( QContactName::DefinitionName ); |
268 QCOMPARE( contactName.value( QContactName::FieldFirstName ), QString("Olga" ) ); |
268 QCOMPARE( contactName.value( QContactName::FieldFirstName ), QString("Olga" ) ); |
269 |
269 |
270 } |
270 } |
271 |
271 |
|
272 //search "5sya' contact match |
|
273 void ST_LogsCntFinderQwerty::testPredictiveEmailSearchNumberAsFirstInPattern() |
|
274 { |
|
275 // Remove all contacts from the database |
|
276 QList<QContactLocalId> cnt_ids = m_manager->contactIds(); |
|
277 m_manager->removeContacts(cnt_ids, 0 ); |
|
278 QVERIFY(0 == cnt_ids.count()); |
|
279 |
|
280 // 'id' first last phonenumber email1 email2 email3 |
|
281 ADD_CONTACT( 1, "Stefann", "Yadira", "0035893424558", "5syadira@gmail.com", "stefann.yadira@nokia.com", "" ); |
|
282 |
|
283 QContactDetailFilter df; |
|
284 df.setDetailDefinitionName(QContactEmailAddress::DefinitionName, QContactEmailAddress::FieldEmailAddress ); |
|
285 df.setMatchFlags( QContactFilter::MatchKeypadCollation ); |
|
286 QContactLocalId cid; |
|
287 QContact contact; |
|
288 QContactName contactName; |
|
289 |
|
290 //search "5sya' contact match |
|
291 QString pattern = QString("5sya") + QChar(30) + QString("vqwerty"); |
|
292 df.setValue( pattern ); |
|
293 cnt_ids = m_manager->contactIds( df ); |
|
294 QCOMPARE( cnt_ids.count(), 1 ); |
|
295 cid = cnt_ids.at( 0 ); |
|
296 contact = m_manager->contact( cid ); |
|
297 contactName = contact.detail( QContactName::DefinitionName ); |
|
298 QCOMPARE( contactName.value( QContactName::FieldFirstName ), QString("Stefann" ) ); |
|
299 |
|
300 |
|
301 } |