remove the sorting at fetching, sort just later

This commit is contained in:
tibbi 2019-12-07 09:32:08 +01:00
parent 9762792388
commit da12f2f8d6
1 changed files with 1 additions and 7 deletions

View File

@ -917,18 +917,12 @@ class ContactsHelper(val context: Context) {
private fun getSortString(): String {
val sorting = context.config.sorting
var sort = when {
return when {
sorting and SORT_BY_FIRST_NAME != 0 -> "${CommonDataKinds.StructuredName.GIVEN_NAME} COLLATE NOCASE"
sorting and SORT_BY_MIDDLE_NAME != 0 -> "${CommonDataKinds.StructuredName.MIDDLE_NAME} COLLATE NOCASE"
sorting and SORT_BY_SURNAME != 0 -> "${CommonDataKinds.StructuredName.FAMILY_NAME} COLLATE NOCASE"
else -> CommonDataKinds.Phone.NUMBER
}
if (sorting and SORT_DESCENDING != 0) {
sort += " DESC"
}
return sort
}
private fun getRealContactId(id: Long): Int {