mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-19 21:20:43 +01:00
move the fetching of local google events in a separate function
This commit is contained in:
parent
038d00ed0a
commit
c9ec5c9606
@ -381,10 +381,14 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||||||
deleteEvents(childIds.toTypedArray())
|
deleteEvents(childIds.toTypedArray())
|
||||||
}
|
}
|
||||||
|
|
||||||
fun deleteGoogleSyncEvents() {
|
fun getGoogleSyncEvents(): List<Event> {
|
||||||
val selection = "$COL_SOURCE = $SOURCE_GOOGLE_SYNC"
|
val selection = "$COL_SOURCE = $SOURCE_GOOGLE_SYNC"
|
||||||
val cursor = getEventsCursor(selection)
|
val cursor = getEventsCursor(selection)
|
||||||
val events = fillEvents(cursor)
|
return fillEvents(cursor)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun deleteGoogleSyncEvents() {
|
||||||
|
val events = getGoogleSyncEvents()
|
||||||
val eventIDs = Array(events.size, { i -> (events[i].id.toString()) })
|
val eventIDs = Array(events.size, { i -> (events[i].id.toString()) })
|
||||||
deleteEvents(eventIDs, false)
|
deleteEvents(eventIDs, false)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user