updating events parentId to Long
This commit is contained in:
parent
94abbaebf5
commit
e535072247
4 changed files with 6 additions and 6 deletions
|
@ -777,7 +777,7 @@ class EventActivity : SimpleActivity() {
|
||||||
} else {
|
} else {
|
||||||
dbHelper.addEventRepeatException(mEvent.id!!, mEventOccurrenceTS, true)
|
dbHelper.addEventRepeatException(mEvent.id!!, mEventOccurrenceTS, true)
|
||||||
mEvent.apply {
|
mEvent.apply {
|
||||||
parentId = id!!
|
parentId = id!!.toLong()
|
||||||
id = null
|
id = null
|
||||||
repeatRule = 0
|
repeatRule = 0
|
||||||
repeatInterval = 0
|
repeatInterval = 0
|
||||||
|
|
|
@ -236,7 +236,7 @@ class CalDAVHandler(val context: Context) {
|
||||||
val parentImportId = "$source-$originalId"
|
val parentImportId = "$source-$originalId"
|
||||||
val parentEventId = context.dbHelper.getEventIdWithImportId(parentImportId)
|
val parentEventId = context.dbHelper.getEventIdWithImportId(parentImportId)
|
||||||
if (parentEventId != 0) {
|
if (parentEventId != 0) {
|
||||||
event.parentId = parentEventId
|
event.parentId = parentEventId.toLong()
|
||||||
context.dbHelper.addEventRepeatException(parentEventId, (originalInstanceTime / 1000).toInt(), false, event.importId)
|
context.dbHelper.addEventRepeatException(parentEventId, (originalInstanceTime / 1000).toInt(), false, event.importId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
||||||
val id = mDb.insert(MAIN_TABLE_NAME, null, eventValues)
|
val id = mDb.insert(MAIN_TABLE_NAME, null, eventValues)
|
||||||
event.id = id.toInt()
|
event.id = id.toInt()
|
||||||
|
|
||||||
if (event.repeatInterval != 0 && event.parentId == 0) {
|
if (event.repeatInterval != 0 && event.parentId == 0L) {
|
||||||
val metaValues = fillMetaValues(event)
|
val metaValues = fillMetaValues(event)
|
||||||
mDb.insert(META_TABLE_NAME, null, metaValues)
|
mDb.insert(META_TABLE_NAME, null, metaValues)
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
||||||
val id = mDb.insert(MAIN_TABLE_NAME, null, eventValues)
|
val id = mDb.insert(MAIN_TABLE_NAME, null, eventValues)
|
||||||
event.id = id.toInt()
|
event.id = id.toInt()
|
||||||
|
|
||||||
if (event.repeatInterval != 0 && event.parentId == 0) {
|
if (event.repeatInterval != 0 && event.parentId == 0L) {
|
||||||
val metaValues = fillMetaValues(event)
|
val metaValues = fillMetaValues(event)
|
||||||
mDb.insert(META_TABLE_NAME, null, metaValues)
|
mDb.insert(META_TABLE_NAME, null, metaValues)
|
||||||
}
|
}
|
||||||
|
@ -271,7 +271,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
||||||
|
|
||||||
childEvent.apply {
|
childEvent.apply {
|
||||||
id = 0
|
id = 0
|
||||||
parentId = parentEventId
|
parentId = parentEventId.toLong()
|
||||||
startTS = 0
|
startTS = 0
|
||||||
endTS = 0
|
endTS = 0
|
||||||
if (childImportId != null) {
|
if (childImportId != null) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ data class Event(var id: Int?, var startTS: Int = 0, var endTS: Int = 0, var tit
|
||||||
var reminder1Minutes: Int = -1, var reminder2Minutes: Int = -1, var reminder3Minutes: Int = -1, var repeatInterval: Int = 0,
|
var reminder1Minutes: Int = -1, var reminder2Minutes: Int = -1, var reminder3Minutes: Int = -1, var repeatInterval: Int = 0,
|
||||||
var importId: String = "", var flags: Int = 0, var repeatLimit: Int = 0, var repeatRule: Int = 0,
|
var importId: String = "", var flags: Int = 0, var repeatLimit: Int = 0, var repeatRule: Int = 0,
|
||||||
var eventType: Long = DBHelper.REGULAR_EVENT_TYPE_ID, var ignoreEventOccurrences: ArrayList<Int> = ArrayList(),
|
var eventType: Long = DBHelper.REGULAR_EVENT_TYPE_ID, var ignoreEventOccurrences: ArrayList<Int> = ArrayList(),
|
||||||
var offset: String = "", var isDstIncluded: Boolean = false, var parentId: Int = 0, var lastUpdated: Long = 0L,
|
var offset: String = "", var isDstIncluded: Boolean = false, var parentId: Long = 0, var lastUpdated: Long = 0L,
|
||||||
var source: String = SOURCE_SIMPLE_CALENDAR, var color: Int = 0, var location: String = "", var isPastEvent: Boolean = false)
|
var source: String = SOURCE_SIMPLE_CALENDAR, var color: Int = 0, var location: String = "", var isPastEvent: Boolean = false)
|
||||||
: Serializable {
|
: Serializable {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue