mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-25 04:50:20 +01:00
fix #300, make the note title check at renaming case insensitive
This commit is contained in:
parent
ded6231dab
commit
4c98d5201e
@ -38,7 +38,7 @@ class RenameNoteDialog(val activity: SimpleActivity, val note: Note, val current
|
||||
private fun newTitleConfirmed(title: String, dialog: AlertDialog) {
|
||||
when {
|
||||
title.isEmpty() -> activity.toast(R.string.no_title)
|
||||
activity.notesDB.getNoteIdWithTitle(title) != null -> activity.toast(R.string.title_taken)
|
||||
activity.notesDB.getNoteIdWithTitleCaseSensitive(title) != null -> activity.toast(R.string.title_taken)
|
||||
else -> {
|
||||
note.title = title
|
||||
if (activity.config.autosaveNotes && currentNoteText != null) {
|
||||
|
@ -17,6 +17,9 @@ interface NotesDao {
|
||||
@Query("SELECT id FROM notes WHERE title = :title COLLATE NOCASE")
|
||||
fun getNoteIdWithTitle(title: String): Long?
|
||||
|
||||
@Query("SELECT id FROM notes WHERE title = :title")
|
||||
fun getNoteIdWithTitleCaseSensitive(title: String): Long?
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
fun insertOrUpdate(note: Note): Long
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user