From da12f2f8d60468b21a15bce171cf44f534bcffec Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 7 Dec 2019 09:32:08 +0100 Subject: [PATCH] remove the sorting at fetching, sort just later --- .../contacts/pro/helpers/ContactsHelper.kt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt index cdd25d4c..0eea63ef 100644 --- a/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/contacts/pro/helpers/ContactsHelper.kt @@ -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 {