[Fixed, not yet released]People app start first character sorting
asked 2016-02-01 21:10:17 +0200
This post is a wiki. Anyone with karma >75 is welcome to improve it.
Hello all,
I have created a localization for Jolla, and it added the following annoying side effect:
In the people app there is a "subview" where the contacts are grouped by the the first letter.
By setting the locale to Hungarian the Hungarian ABC's accented and double characters (ty, ny, etc.) groups got shown. Unfortunatelly the unaccented characters are got grouped to the accented ones, and the unaccented group is empty.
I have checked the jolla-contacts and the /usr/lib/qt5/qml/Sailfish/Contacts/*qml files, but I have not found any references to these sortings.
Any directions, suggestions would be helpful!
Thank you in advance!
The People app is populated from the SeasideNameGroupModel, which populates itself by calling SeasideCache::nameGroupMembers();
https://git.merproject.org/mer-core/nemo-qml-plugin-contacts/blob/master/src/seasidenamegroupmodel.cpp#L49
The SeasideCache will place individual contacts into specific name-groups when the contacts are added to the cache:
https://git.merproject.org/mer-core/libcontacts/blob/master/src/seasidecache.cpp#L793
Note that it calls SeasideNameGrouper::nameGroupForContact() to see if there is some special language-specific name grouping which should be applied (currently, Jolla internally has some closed-source name groupings for Chinese language), but then falls back to a default name-group allocation which basically just asks the current locale settings which bucket it should be in based upon either the name or display label data:
https://git.merproject.org/mer-core/libcontacts/blob/master/src/seasidecache.cpp#L808
I don't immediately know a good way to resolve your issue. There are a couple of possibilities:
1) implement your own name-grouper (but then you'd need to get your patch into our closed-source components which provide the name grouping...)
2) perhaps the locale settings have a plugin mechanism to allow extending / improving them, in which case you could override the return value from mLocale.indexBucket().
chris.adams ( 2016-02-02 07:29:49 +0200 )editDear Chris,
Thank you very much for spending time on this issue and writing the detailed description.
So if my understanding is correct the Jolla created an own sublcass from the SeasideNameGrouper. which is going to return a group which will prevent me from overriding that result later with the mLocale results.
I have checked the MLocale codes, but I have not found any signs of handling the Hungarian alphabet specially. so that should be patched either or other way.
Do you know about any official way how could I request Jolla to release that particular library publicly or even under NDA for patching?
Thanks again!
martonmiklos ( 2016-02-02 22:56:36 +0200 )editWell, I'm not certain whether the (Chinese-language-specific) name groupers are being used for the text in your case. I would assume that they're not, but perhaps they are? So, I suspect that the grouping is purely being determined by the MLocale result - and if that doesn't handle Hungarian characters properly, then the grouping will be wrong.
I think you should raise this issue at the Sailfish Community Meeting (see https://together.jolla.com/question/54157/sailfishos-open-source-collaboration-meeting-planning/) and specifically ask Pekka or Joona about the MLocale issue, and Carsten or Vesa-Matti about the opensourcing request.
chris.adams ( 2016-02-05 01:55:34 +0200 )edit