fix some glitches with importing event description and location newlines

This commit is contained in:
tibbi 2020-09-28 16:07:54 +02:00
parent 35d60d8027
commit 3458ed3453
1 changed files with 6 additions and 0 deletions

View File

@ -104,6 +104,9 @@ class IcsImporter(val activity: SimpleActivity) {
curTitle = getTitle(curTitle).replace("\\n", "\n").replace("\\,", ",")
} else if (line.startsWith(DESCRIPTION) && !isNotificationDescription) {
curDescription = line.substring(DESCRIPTION.length).replace("\\n", "\n").replace("\\,", ",")
if (curDescription.trim().isEmpty()) {
curDescription = ""
}
isDescription = true
} else if (line.startsWith(UID)) {
curImportId = line.substring(UID.length).trim()
@ -141,6 +144,9 @@ class IcsImporter(val activity: SimpleActivity) {
curRepeatExceptions.add(Formatter.getDayCodeFromTS(getTimestamp(value)))
} else if (line.startsWith(LOCATION)) {
curLocation = getLocation(line.substring(LOCATION.length).replace("\\,", ","))
if (curLocation.trim().isEmpty()) {
curLocation = ""
}
} else if (line.startsWith(RECURRENCE_ID)) {
val timestamp = getTimestamp(line.substring(RECURRENCE_ID.length))
curRecurrenceDayCode = Formatter.getDayCodeFromTS(timestamp)