removing a probably/hopefully redundant function

This commit is contained in:
tibbi 2018-11-15 11:59:38 +01:00
parent 427a3fa6fc
commit 76c92eea78
2 changed files with 1 additions and 29 deletions

View File

@ -180,28 +180,6 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
return events return events
} }
private fun getAllDayEvents(fromTS: Long, eventId: Long = -1L, applyTypeFilter: Boolean = false): List<Event> {
val events = ArrayList<Event>()
var selection = "($COL_FLAGS & $FLAG_ALL_DAY) != 0"
if (eventId != -1L)
selection += " AND $MAIN_TABLE_NAME.$COL_ID = $eventId"
if (applyTypeFilter) {
val displayEventTypes = context.config.displayEventTypes
if (displayEventTypes.isEmpty()) {
return ArrayList()
} else {
val types = TextUtils.join(",", displayEventTypes)
selection += " AND $COL_EVENT_TYPE IN ($types)"
}
}
val dayCode = Formatter.getDayCodeFromTS(fromTS)
val cursor = getEventsCursor(selection)
events.addAll(fillEvents(cursor).filter { dayCode == Formatter.getDayCodeFromTS(it.startTS) })
return events
}
fun getRunningEvents(): List<Event> { fun getRunningEvents(): List<Event> {
val events = ArrayList<Event>() val events = ArrayList<Event>()
val ts = getNowSeconds() val ts = getNowSeconds()

View File

@ -282,13 +282,7 @@ class EventsHelper(val context: Context) {
} }
} }
/*val selectionArgs = arrayOf(toTS.toString(), fromTS.toString()) // events.addAll(getRepeatableEventsFor(fromTS, toTS, eventId, applyTypeFilter))
val cursor = getEventsCursor(selection, selectionArgs)
events.addAll(fillEvents(cursor))
events.addAll(getRepeatableEventsFor(fromTS, toTS, eventId, applyTypeFilter))
events.addAll(getAllDayEvents(fromTS, eventId, applyTypeFilter))*/
events = events events = events
.asSequence() .asSequence()