mirror of
https://github.com/etesync/android
synced 2024-11-22 16:08:13 +00:00
Upgrade ical4android.
This commit is contained in:
parent
8527ec29d8
commit
5db8545f8f
@ -81,7 +81,7 @@ constructor(context: Context, account: Account, settings: AccountSettings, extra
|
|||||||
override fun processSyncEntryImpl(cEntry: SyncEntry) {
|
override fun processSyncEntryImpl(cEntry: SyncEntry) {
|
||||||
val inputReader = StringReader(cEntry.content)
|
val inputReader = StringReader(cEntry.content)
|
||||||
|
|
||||||
val events = Event.fromReader(inputReader)
|
val events = Event.eventsFromReader(inputReader)
|
||||||
if (events.size == 0) {
|
if (events.size == 0) {
|
||||||
Logger.log.warning("Received VCard without data, ignoring")
|
Logger.log.warning("Received VCard without data, ignoring")
|
||||||
return
|
return
|
||||||
|
@ -71,7 +71,7 @@ class TasksSyncManager(
|
|||||||
override fun processSyncEntryImpl(cEntry: SyncEntry) {
|
override fun processSyncEntryImpl(cEntry: SyncEntry) {
|
||||||
val inputReader = StringReader(cEntry.content)
|
val inputReader = StringReader(cEntry.content)
|
||||||
|
|
||||||
val tasks = Task.fromReader(inputReader)
|
val tasks = Task.tasksFromReader(inputReader)
|
||||||
if (tasks.size == 0) {
|
if (tasks.size == 0) {
|
||||||
Logger.log.warning("Received VCard without data, ignoring")
|
Logger.log.warning("Received VCard without data, ignoring")
|
||||||
return
|
return
|
||||||
|
@ -106,7 +106,7 @@ class JournalItemActivity : BaseActivity(), Refreshable {
|
|||||||
CollectionInfo.Type.CALENDAR -> {
|
CollectionInfo.Type.CALENDAR -> {
|
||||||
val provider = contentResolver.acquireContentProviderClient(CalendarContract.CONTENT_URI)!!
|
val provider = contentResolver.acquireContentProviderClient(CalendarContract.CONTENT_URI)!!
|
||||||
val localCalendar = LocalCalendar.findByName(account, provider, LocalCalendar.Factory, info.uid!!)!!
|
val localCalendar = LocalCalendar.findByName(account, provider, LocalCalendar.Factory, info.uid!!)!!
|
||||||
val event = Event.fromReader(StringReader(syncEntry.content))[0]
|
val event = Event.eventsFromReader(StringReader(syncEntry.content))[0]
|
||||||
var localEvent = localCalendar.findByUid(event.uid!!)
|
var localEvent = localCalendar.findByUid(event.uid!!)
|
||||||
if (localEvent != null) {
|
if (localEvent != null) {
|
||||||
localEvent.updateAsDirty(event)
|
localEvent.updateAsDirty(event)
|
||||||
@ -118,7 +118,7 @@ class JournalItemActivity : BaseActivity(), Refreshable {
|
|||||||
CollectionInfo.Type.TASKS -> {
|
CollectionInfo.Type.TASKS -> {
|
||||||
val provider = TaskProvider.acquire(this, TaskProvider.ProviderName.OpenTasks)!!
|
val provider = TaskProvider.acquire(this, TaskProvider.ProviderName.OpenTasks)!!
|
||||||
val localTaskList = LocalTaskList.findByName(account, provider, LocalTaskList.Factory, info.uid!!)!!
|
val localTaskList = LocalTaskList.findByName(account, provider, LocalTaskList.Factory, info.uid!!)!!
|
||||||
val task = Task.fromReader(StringReader(syncEntry.content))[0]
|
val task = Task.tasksFromReader(StringReader(syncEntry.content))[0]
|
||||||
var localTask = localTaskList.findByUid(task.uid!!)
|
var localTask = localTaskList.findByUid(task.uid!!)
|
||||||
if (localTask != null) {
|
if (localTask != null) {
|
||||||
localTask.updateAsDirty(task)
|
localTask.updateAsDirty(task)
|
||||||
@ -245,7 +245,7 @@ class JournalItemActivity : BaseActivity(), Refreshable {
|
|||||||
val inputReader = StringReader(syncEntry.content)
|
val inputReader = StringReader(syncEntry.content)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
event = Event.fromReader(inputReader, null)[0]
|
event = Event.eventsFromReader(inputReader, null)[0]
|
||||||
} catch (e: InvalidCalendarException) {
|
} catch (e: InvalidCalendarException) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
@ -316,7 +316,7 @@ class JournalItemActivity : BaseActivity(), Refreshable {
|
|||||||
val inputReader = StringReader(syncEntry.content)
|
val inputReader = StringReader(syncEntry.content)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
task = Task.fromReader(inputReader)[0]
|
task = Task.tasksFromReader(inputReader)[0]
|
||||||
} catch (e: InvalidCalendarException) {
|
} catch (e: InvalidCalendarException) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
|
@ -216,7 +216,7 @@ class ImportFragment : DialogFragment() {
|
|||||||
val importReader = InputStreamReader(inputStream)
|
val importReader = InputStreamReader(inputStream)
|
||||||
|
|
||||||
if (info.type == CollectionInfo.Type.CALENDAR) {
|
if (info.type == CollectionInfo.Type.CALENDAR) {
|
||||||
val events = Event.fromReader(importReader, null)
|
val events = Event.eventsFromReader(importReader, null)
|
||||||
importReader.close()
|
importReader.close()
|
||||||
|
|
||||||
if (events.isEmpty()) {
|
if (events.isEmpty()) {
|
||||||
@ -269,7 +269,7 @@ class ImportFragment : DialogFragment() {
|
|||||||
entryProcessed()
|
entryProcessed()
|
||||||
}
|
}
|
||||||
} else if (info.type == CollectionInfo.Type.TASKS) {
|
} else if (info.type == CollectionInfo.Type.TASKS) {
|
||||||
val tasks = Task.fromReader(importReader)
|
val tasks = Task.tasksFromReader(importReader)
|
||||||
importReader.close()
|
importReader.close()
|
||||||
|
|
||||||
if (tasks.isEmpty()) {
|
if (tasks.isEmpty()) {
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 0458700717a1d2190c252b340cfb6ddd2dfbeebd
|
Subproject commit b5de481b186e38c0894c238fe16a37589e88f2b7
|
Loading…
Reference in New Issue
Block a user