Merge branch 'develop' into feature/Database_Call

This commit is contained in:
J-Jamet
2021-04-29 17:54:23 +02:00
5 changed files with 6 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
KeePassDX(3.0.0) KeePassDX(3.0.0)
* Fix search with non-latin chars #971 * Fix search with non-latin chars #971
* Fix action mode with search #972 * Fix action mode with search #972 (rollback ignore accents #945)
KeePassDX(2.9.19) KeePassDX(2.9.19)
* Fix search slowdown #964 * Fix search slowdown #964

View File

@@ -29,7 +29,6 @@ import com.kunzisoft.keepass.model.SearchInfo
import com.kunzisoft.keepass.otp.OtpEntryFields.OTP_FIELD import com.kunzisoft.keepass.otp.OtpEntryFields.OTP_FIELD
import com.kunzisoft.keepass.settings.PreferencesUtil import com.kunzisoft.keepass.settings.PreferencesUtil
import com.kunzisoft.keepass.timeout.TimeoutHelper import com.kunzisoft.keepass.timeout.TimeoutHelper
import com.kunzisoft.keepass.utils.StringUtil.removeAccents
import com.kunzisoft.keepass.utils.UuidUtil import com.kunzisoft.keepass.utils.UuidUtil
class SearchHelper { class SearchHelper {
@@ -177,13 +176,13 @@ class SearchHelper {
// TODO Search settings // TODO Search settings
var regularExpression = false var regularExpression = false
var ignoreCase = true var ignoreCase = true
var removeAccents = true var removeAccents = true <- Too much time, to study
var excludeExpired = false var excludeExpired = false
var searchOnlyInCurrentGroup = false var searchOnlyInCurrentGroup = false
*/ */
return stringToCheck.isNotEmpty() return stringToCheck.isNotEmpty()
&& stringToCheck.removeAccents().contains( && stringToCheck.contains(
searchParameters.searchQuery.removeAccents(), true) searchParameters.searchQuery, true)
} }
} }
} }

View File

@@ -12,10 +12,5 @@ object StringUtil {
return this.replace("[\\r|\\n|\\t|\\s|\\u00A0]+".toRegex(), "") return this.replace("[\\r|\\n|\\t|\\s|\\u00A0]+".toRegex(), "")
} }
fun String.removeAccents(): String {
return Normalizer.normalize(this, Normalizer.Form.NFD)
.replace("\\p{Mn}+".toRegex(), "")
}
fun ByteArray.toHexString() = joinToString("") { "%02X".format(it) } fun ByteArray.toHexString() = joinToString("") { "%02X".format(it) }
} }

View File

@@ -1,2 +1,2 @@
* Fix search with non-latin chars #971 * Fix search with non-latin chars #971
* Fix action mode with search #972 * Fix action mode with search #972 (rollback ignore accents #945)

View File

@@ -1,2 +1,2 @@
* Correction de la recherche avec des caractères non latin #971 * Correction de la recherche avec des caractères non latin #971
* Correction du mode action avec la recherche #972 * Correction du mode action avec la recherche #972 (retour arrière des accents ignorés #945)