Skip to content

Draft: Add display by LastName/FirstName or FirstName/LastName

Lionel Duboeuf requested to merge personal/lduboeuf/sortbylastname into main

NOT a viable solution. We need to implement it in backend. But that needs some works i don't know well, especially for next backend.

We need to have a setting readable from the backend + notifyable ( not sure if need to have a property change watch ). Property settable via address-book-app. A method to calculate the DisplayLabel according to user specificity ( Sailfish have one rather complete in their qml plugin https://github.com/sailfishos/nemo-qml-plugin-contacts ) But only allowing to generate a displayLabel at runtime is not enough. The contact list query database and a sort is done there. Doing a sort Later will performs badly. So best would be to generate Labels at update/save and at display policy change.

Qtcontacts-sqlite have a mechanism closer to that with their displayLabelGroup ( available on QtPim 6), and can be used for sections

fixes #12

This is a solution with the less change in code. Otherwise we would need to do it on backend side and will also have an impact with the next backend architecture. Default DisplayLabel can't be used as it is hard coded as "FirstName LastName". The idea is at each contact list change to calculate it according to the display policy ( either FirstName LastName or LastName FirstName order). ~~ Capture_d_écran_de_2023-05-06_11-46-21

Edited by Lionel Duboeuf

Merge request reports