mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-17 12:20:51 +01:00
renaming a function
This commit is contained in:
parent
e3b4be65d3
commit
377c0f2e28
@ -172,7 +172,7 @@ class SettingsActivity : SimpleActivity() {
|
||||
|
||||
Thread {
|
||||
if (newCalendarIds.isNotEmpty()) {
|
||||
val existingEventTypeNames = dbHelper.fetchEventTypes().map { it.getDisplayTitle().toLowerCase() } as ArrayList<String>
|
||||
val existingEventTypeNames = dbHelper.getEventTypesSync().map { it.getDisplayTitle().toLowerCase() } as ArrayList<String>
|
||||
getSyncedCalDAVCalendars().forEach {
|
||||
val calendarTitle = it.getFullTitle()
|
||||
if (!existingEventTypeNames.contains(calendarTitle.toLowerCase())) {
|
||||
|
@ -14,7 +14,7 @@ class FilterEventTypesDialog(val activity: SimpleActivity, val callback: () -> U
|
||||
val view = activity.layoutInflater.inflate(R.layout.dialog_filter_event_types, null)
|
||||
|
||||
init {
|
||||
val eventTypes = activity.dbHelper.fetchEventTypes()
|
||||
val eventTypes = activity.dbHelper.getEventTypesSync()
|
||||
val displayEventTypes = activity.config.displayEventTypes
|
||||
view.filter_event_types_list.adapter = FilterEventTypeAdapter(activity, eventTypes, displayEventTypes)
|
||||
|
||||
|
@ -875,7 +875,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
||||
|
||||
private fun fillEvents(cursor: Cursor?): List<Event> {
|
||||
val eventTypeColors = SparseIntArray()
|
||||
fetchEventTypes().forEach {
|
||||
getEventTypesSync().forEach {
|
||||
eventTypeColors.put(it.id, it.color)
|
||||
}
|
||||
|
||||
@ -917,6 +917,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
||||
val event = Event(id, startTS, endTS, title, description, reminder1Minutes, reminder2Minutes, reminder3Minutes,
|
||||
repeatInterval, importId, flags, repeatLimit, repeatRule, eventType, ignoreEventOccurrences, offset, isDstIncluded,
|
||||
0, lastUpdated, source, color, location)
|
||||
|
||||
events.add(event)
|
||||
} while (cursor.moveToNext())
|
||||
}
|
||||
@ -926,11 +927,11 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
||||
|
||||
fun getEventTypes(callback: (types: ArrayList<EventType>) -> Unit) {
|
||||
Thread {
|
||||
callback(fetchEventTypes())
|
||||
callback(getEventTypesSync())
|
||||
}.start()
|
||||
}
|
||||
|
||||
fun fetchEventTypes(): ArrayList<EventType> {
|
||||
fun getEventTypesSync(): ArrayList<EventType> {
|
||||
val eventTypes = ArrayList<EventType>(4)
|
||||
val cols = arrayOf(COL_TYPE_ID, COL_TYPE_TITLE, COL_TYPE_COLOR, COL_TYPE_CALDAV_CALENDAR_ID, COL_TYPE_CALDAV_DISPLAY_NAME, COL_TYPE_CALDAV_EMAIL)
|
||||
var cursor: Cursor? = null
|
||||
@ -951,6 +952,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
||||
} finally {
|
||||
cursor?.close()
|
||||
}
|
||||
|
||||
return eventTypes
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user