[qtMoko] How Contact selection UI is filled

Radek Polak psonek2 at seznam.cz
Thu Jan 26 10:41:05 CET 2012


On Wednesday 25 January 2012 17:05:40 Guilhem Bonnefille wrote:

> I still not know precisely what code is running when I select
> recipients of a SMS. But I found many codes doing similar things, but
> differently.
> 
> QContactSelector (in src/libraries/qtopiapim/qcontactview.cpp) allow
> to select a single contact (I think) but return a QContact reference.
> The caller is then responsible of picking the right info and
> requesting a new selection from the user if the selected contact has
> many possible info (see src/server/phone/dialer/touch/dialer.cpp).
> This seems quite a good design.
> 
> I also found AddressSelectorWidget (in
> src/libraries/qtopiamail/addressselectorwidget.cpp). It allows to
> select many recipients. But, by design, it does not allow to select
> the phone number of a contact when this contact has many phone
> numbers. The info used are only the defaultPhone or defaultEmail. This
> selector is interesting as it allow to select many contacts and offers
> a "Find" feature.
> 
> What's the right way to fix the issue? I imagine the best one is to
> merge these selectors. But I'm really too new to qtMoko's hacking to
> decide the way to merge these codes.
> Any suggestion is welcome.

Hmm the stuff around mail is quite complicated and IMO overengineered, but it's 
working quite good. I am afraid that big changes can break it.

I think the multiple selection was supposed to work like this:

- If contact has one phone number it's always used
- If contact has two or more numbers you can edit the contact and set default 
phone number. This number is then used without asking.

QContact has defaultPhoneNumber property [1] - it think it was for this 
purpose. But i cant see a place where it is used in code and where you can set 
it up from ui...

You could get better overview how it works if you compile qtmoko with debug (i 
think it's -debug configure switch) and then use gdb on your phone on the 
qtmail application.

I might want to take a look at it too, but i am currently a bit busy.

Regards

Radek



[1] http://radekp.github.com/qtmoko/api/qcontact.html#defaultPhoneNumber



More information about the community mailing list