Rename todo to task

This commit is contained in:
Naveen 2023-01-15 03:37:15 +05:30
parent 01c8a4c977
commit be8b2a3fe5
2 changed files with 6 additions and 6 deletions

View File

@ -146,8 +146,8 @@ const val CALENDAR_PRODID = "PRODID:-//Simple Mobile Tools//NONSGML Event Calend
const val CALENDAR_VERSION = "VERSION:2.0"
const val BEGIN_EVENT = "BEGIN:VEVENT"
const val END_EVENT = "END:VEVENT"
const val BEGIN_TODO = "BEGIN:VTODO"
const val END_TODO = "END:VTODO"
const val BEGIN_TASK = "BEGIN:VTODO"
const val END_TASK = "END:VTODO"
const val BEGIN_ALARM = "BEGIN:VALARM"
const val END_ALARM = "END:VALARM"
const val DTSTART = "DTSTART"

View File

@ -64,7 +64,7 @@ class IcsExporter(private val activity: BaseSimpleActivity) {
out.writeLn(CALENDAR_VERSION)
for (event in events) {
if (event.isTask()) {
writeTodo(out, event)
writeTask(out, event)
} else {
writeEvent(out, event)
}
@ -160,9 +160,9 @@ class IcsExporter(private val activity: BaseSimpleActivity) {
}
}
private fun writeTodo(writer: BufferedWriter, task: Event) {
private fun writeTask(writer: BufferedWriter, task: Event) {
with(writer) {
writeLn(BEGIN_TODO)
writeLn(BEGIN_TASK)
task.title.replace("\n", "\\n").let { if (it.isNotEmpty()) writeLn("$SUMMARY:$it") }
task.importId.let { if (it.isNotEmpty()) writeLn("$UID$it") }
writeLn("$CATEGORY_COLOR${activity.eventTypesDB.getEventTypeWithId(task.eventType)?.color}")
@ -187,7 +187,7 @@ class IcsExporter(private val activity: BaseSimpleActivity) {
fillIgnoredOccurrences(task, writer)
eventsExported++
writeLn(END_TODO)
writeLn(END_TASK)
}
}
}