Reply
Thread Tools
kif's Avatar
Posts: 60 | Thanked: 40 times | Joined on May 2010 @ Skovballe, Denmark
#1
Hi

What is the best way to find a contact from a phone number ?

I know I can use

Code:
QContactManager.contacts(QContactPhoneNumber::match(phonenumber));
but it only finds the contact if the phone numbers is exactly equal, and that I can be almost sure isn't the case !

How do you do it ?

(I'm using QT on Maemo5)

Kim Foder
 
Posts: 248 | Thanked: 240 times | Joined on Mar 2010 @ Wiltshire, UK
#2
Dial the number and the phone app will display the contact name on screen unless you've entered it twice...

Works for me!

EDIT:

Just read your post again and see your point...

Scout will find a partial phone number, though.

Last edited by NokTokDaddy; 2010-09-08 at 20:51.
 
kif's Avatar
Posts: 60 | Thanked: 40 times | Joined on May 2010 @ Skovballe, Denmark
#3
OK, I asked for that one NokTokDaddy

What I meant is of course how I find a contact from my program, using QT ?

Kim
 
Posts: 248 | Thanked: 240 times | Joined on Mar 2010 @ Wiltshire, UK
#4
Kim, you are obviously in a higher technical orbit than me!

Good luck in your search!
 
int_ua's Avatar
Posts: 676 | Thanked: 1,067 times | Joined on Jul 2010 @ Kyiv, Ukraine
#5
just install scout package from repository (it's version 0.0.6 so I assume it's from devel or testing. Anyway, works great.)
 
int_ua's Avatar
Posts: 676 | Thanked: 1,067 times | Joined on Jul 2010 @ Kyiv, Ukraine
#6
Oh, messed scout with extended-contacts-search. The last one adds ability to native contacts application.
 
Posts: 1,463 | Thanked: 1,916 times | Joined on Feb 2008 @ Edmonton, AB
#7
sorry man i don't know QT. you could try asking on IRC, there's a lot of people logged in there. #maemo on freenode
 
Posts: 180 | Thanked: 76 times | Joined on May 2010
#8
Use QContactManager::contactIds(...)
You can pass QContactFilter as a parameter.

E: I haven't tried this but use QContactDetailFilter as filter and set QContactPhoneNumber as detailDefinitionName and set part of phone number to value.

Last edited by Diph; 2010-09-09 at 15:16.
 
Posts: 1,096 | Thanked: 760 times | Joined on Dec 2008
#9
Originally Posted by Diph View Post
Use QContactManager::contactIds(...)
You can pass QContactFilter as a parameter.

E: I haven't tried this but use QContactDetailFilter as filter and set QContactPhoneNumber as detailDefinitionName and set part of phone number to value.
looks like you would also need MatchFlag MatchContains to do what he wants

http://doc.qt.nokia.com/qtmobility-1...MatchFlag-enum

never tried it though
 
kif's Avatar
Posts: 60 | Thanked: 40 times | Joined on May 2010 @ Skovballe, Denmark
#10
Hi

I have tested with QContactManager::contactIds(...) with different combinations of match flags, but my problem remains

Basically my problem boils down to the following :

I am looking for the contact with phone number +45 123 456 but in the contact the number is 123 456.

Ideally the match flag QContactFilter::MatchPhoneNumber should be able to find the contact (at least as I read the description) :

The search term is considered to be in the form of a phone number, and special processing (removing dialing prefixes, non significant characters like '-'. ')' etc). may be performed when matching the item.
but in my tests it does not find the contact

int_ua : I haven't tried with extended-contacts-search but probably will.

Kim
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 22:32.