← Back to team overview

touch-packages team mailing list archive

[Bug 1421245] Re: Contact search doesn't support Chinese

 

I suspect the rest of the onValueChanged handler is mistaken too:

                if (containsLetter && (filters.length > 1)) {
                    filters = [filters[0]]
                } else if (!containsLetter) {
                    filters = [filters[0], phoneNumberFilter]
                }

If I understand it correctly, that's assuming a token that doesn't
contain a letter must be part of a phone number, which isn't true. For
example, in London, The Bar With No Name is also known as 69 Colebrooke
Row because that is its address. But if I add a contact with that name
and address, and then search for "69", I get no results, presumably
because the address book is looking for "69" only in the phone number
and not finding it.

If it is legitimate to be using a containsLetter here, though, I think
it needs to be a function that calls isLetter() on each character of the
string, stopping and returning true if any of those calls return true.
isLetter() does the right thing by checking whether the character is in
*any* of the Unicode Letter- categories, not just [a-zA-Z].
<http://doc.qt.io/qt-5/qchar.html#isLetter> Unfortunately there doesn't
seem to be any equivalent element for this in QRegExp.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to address-book-app in
Ubuntu.
https://bugs.launchpad.net/bugs/1421245

Title:
  Contact search doesn't support Chinese

Status in the base for Ubuntu mobile products:
  New
Status in address-book-app package in Ubuntu:
  Confirmed
Status in dialer-app package in Ubuntu:
  Confirmed
Status in messaging-app package in Ubuntu:
  Confirmed

Bug description:
  Steps to reproduce

  1) Create a contact with a Chinese name

  2) Type that name in to the contact search

  Expected result

  Just that contact should appear

  Actual result

  All contacts appear

To manage notifications about this bug go to:
https://bugs.launchpad.net/canonical-devices-system-image/+bug/1421245/+subscriptions


References