mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
fix #571, rmeove some glitches related to events moving between event types
This commit is contained in:
@ -705,10 +705,10 @@ class EventActivity : SimpleActivity() {
|
|||||||
val newEventType = if (!config.caldavSync || config.lastUsedCaldavCalendarId == 0 || mEventCalendarId == STORED_LOCALLY_ONLY) {
|
val newEventType = if (!config.caldavSync || config.lastUsedCaldavCalendarId == 0 || mEventCalendarId == STORED_LOCALLY_ONLY) {
|
||||||
mEventTypeId
|
mEventTypeId
|
||||||
} else {
|
} else {
|
||||||
dbHelper.getEventTypeWithCalDAVCalendarId(config.lastUsedCaldavCalendarId)?.id ?: config.lastUsedLocalEventTypeId
|
dbHelper.getEventTypeWithCalDAVCalendarId(mEventCalendarId)?.id ?: config.lastUsedLocalEventTypeId
|
||||||
}
|
}
|
||||||
|
|
||||||
val newSource = if (!config.caldavSync || config.lastUsedCaldavCalendarId == 0 || mEventCalendarId == STORED_LOCALLY_ONLY) {
|
val newSource = if (!config.caldavSync || mEventCalendarId == STORED_LOCALLY_ONLY) {
|
||||||
config.lastUsedLocalEventTypeId = newEventType
|
config.lastUsedLocalEventTypeId = newEventType
|
||||||
SOURCE_SIMPLE_CALENDAR
|
SOURCE_SIMPLE_CALENDAR
|
||||||
} else {
|
} else {
|
||||||
|
@ -602,7 +602,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||||||
val selectionArgs = arrayOf(eventTypeId.toString())
|
val selectionArgs = arrayOf(eventTypeId.toString())
|
||||||
val cursor = getEventsCursor(selection, selectionArgs)
|
val cursor = getEventsCursor(selection, selectionArgs)
|
||||||
val events = fillEvents(cursor)
|
val events = fillEvents(cursor)
|
||||||
val eventIDs = Array(events.size, { i -> (events[i].id.toString()) })
|
val eventIDs = Array(events.size) { i -> (events[i].id.toString()) }
|
||||||
deleteEvents(eventIDs, true)
|
deleteEvents(eventIDs, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -985,7 +985,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun getEventTypesSync(): ArrayList<EventType> {
|
fun getEventTypesSync(): ArrayList<EventType> {
|
||||||
val eventTypes = ArrayList<EventType>(4)
|
val eventTypes = ArrayList<EventType>()
|
||||||
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)
|
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
|
var cursor: Cursor? = null
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user