Akonadi abook: do not filter out email addresses with odd ‘logic’
commit21c98b9f04586064671ac39cd28113b914983b9e
authorRoland Pallai <dap78@magex.hu>
Fri, 2 Feb 2018 15:29:34 +0000 (2 16:29 +0100)
committerRoland Pallai <dap78@magex.hu>
Fri, 2 Feb 2018 16:32:14 +0000 (2 18:32 +0200)
tree3b7a0e6b41918ccccf0d8619009fdda23df4a4c7
parentbea4a1d5af8cc5dd77e4524a171dba235231d6c6
Akonadi abook: do not filter out email addresses with odd ‘logic’

There is an odd logic that "tries to sort out irrelevant email
addresses" such way that filters out non-matching email addresses
if the search condition matched on one or more. The goal is to make
search by email address more comfortable.

But this behaviour quietly and unfairly prefers matching by email
address over contact name as Erik Quaeghebeur pointed out on Trojitá
mailing list:
"For example, one contact of mine has 4 addresses. The search result
is effectively unique after entering the first four characters of their
first name. However, because this first name only appears in one
address, only that address is returned. I need to type the full first
name and a space to override the logic and trigger true
search-by-contact-name."

So this patch introduces a fairer logic which puts the matching email
addresses first and then the rest - without filtering.

Change-Id: I16b8f74a672c9864d9da994ac90d7bf9738f6001
src/Plugins/AkonadiAddressbook/AkonadiAddressbookCompletionJob.cpp