mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-06-05 17:00:23 +02:00
moving another function in Room
This commit is contained in:
@ -78,19 +78,6 @@ class DBHelper private constructor(private val mContext: Context) : SQLiteOpenHe
|
||||
mDb.delete(WIDGETS_TABLE_NAME, "$COL_NOTE_ID = $id", null)
|
||||
}
|
||||
|
||||
fun doesNoteTitleExist(title: String): Boolean {
|
||||
val cols = arrayOf(COL_ID)
|
||||
val selection = "$COL_TITLE = ? COLLATE NOCASE"
|
||||
val selectionArgs = arrayOf(title)
|
||||
var cursor: Cursor? = null
|
||||
try {
|
||||
cursor = mDb.query(NOTES_TABLE_NAME, cols, selection, selectionArgs, null, null, null)
|
||||
return cursor.count == 1
|
||||
} finally {
|
||||
cursor?.close()
|
||||
}
|
||||
}
|
||||
|
||||
fun getWidgets(): ArrayList<Widget> {
|
||||
val widgets = ArrayList<Widget>()
|
||||
val cols = arrayOf(COL_WIDGET_ID, COL_NOTE_ID)
|
||||
|
Reference in New Issue
Block a user