store caldav calendar type too
This commit is contained in:
parent
f5e85c4a50
commit
c5c8b89f98
|
@ -49,6 +49,7 @@ class CalDAVHandler(val context: Context) {
|
||||||
CalendarContract.Calendars._ID,
|
CalendarContract.Calendars._ID,
|
||||||
CalendarContract.Calendars.CALENDAR_DISPLAY_NAME,
|
CalendarContract.Calendars.CALENDAR_DISPLAY_NAME,
|
||||||
CalendarContract.Calendars.ACCOUNT_NAME,
|
CalendarContract.Calendars.ACCOUNT_NAME,
|
||||||
|
CalendarContract.Calendars.ACCOUNT_TYPE,
|
||||||
CalendarContract.Calendars.OWNER_ACCOUNT,
|
CalendarContract.Calendars.OWNER_ACCOUNT,
|
||||||
CalendarContract.Calendars.CALENDAR_COLOR,
|
CalendarContract.Calendars.CALENDAR_COLOR,
|
||||||
CalendarContract.Calendars.CALENDAR_ACCESS_LEVEL)
|
CalendarContract.Calendars.CALENDAR_ACCESS_LEVEL)
|
||||||
|
@ -62,10 +63,11 @@ class CalDAVHandler(val context: Context) {
|
||||||
val id = cursor.getIntValue(CalendarContract.Calendars._ID)
|
val id = cursor.getIntValue(CalendarContract.Calendars._ID)
|
||||||
val displayName = cursor.getStringValue(CalendarContract.Calendars.CALENDAR_DISPLAY_NAME)
|
val displayName = cursor.getStringValue(CalendarContract.Calendars.CALENDAR_DISPLAY_NAME)
|
||||||
val accountName = cursor.getStringValue(CalendarContract.Calendars.ACCOUNT_NAME)
|
val accountName = cursor.getStringValue(CalendarContract.Calendars.ACCOUNT_NAME)
|
||||||
|
val accountType = cursor.getStringValue(CalendarContract.Calendars.ACCOUNT_TYPE)
|
||||||
val ownerName = cursor.getStringValue(CalendarContract.Calendars.OWNER_ACCOUNT)
|
val ownerName = cursor.getStringValue(CalendarContract.Calendars.OWNER_ACCOUNT)
|
||||||
val color = cursor.getIntValue(CalendarContract.Calendars.CALENDAR_COLOR)
|
val color = cursor.getIntValue(CalendarContract.Calendars.CALENDAR_COLOR)
|
||||||
val accessLevel = cursor.getIntValue(CalendarContract.Calendars.CALENDAR_ACCESS_LEVEL)
|
val accessLevel = cursor.getIntValue(CalendarContract.Calendars.CALENDAR_ACCESS_LEVEL)
|
||||||
val calendar = CalDAVCalendar(id, displayName, accountName, ownerName, color, accessLevel)
|
val calendar = CalDAVCalendar(id, displayName, accountName, accountType, ownerName, color, accessLevel)
|
||||||
calendars.add(calendar)
|
calendars.add(calendar)
|
||||||
} while (cursor.moveToNext())
|
} while (cursor.moveToNext())
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.simplemobiletools.calendar.models
|
package com.simplemobiletools.calendar.models
|
||||||
|
|
||||||
data class CalDAVCalendar(val id: Int, val displayName: String, val accountName: String, val ownerName: String, val color: Int, val accessLevel: Int) {
|
data class CalDAVCalendar(val id: Int, val displayName: String, val accountName: String, val accountType: String, val ownerName: String,
|
||||||
|
val color: Int, val accessLevel: Int) {
|
||||||
fun canWrite() = accessLevel >= 500
|
fun canWrite() = accessLevel >= 500
|
||||||
|
|
||||||
fun getFullTitle() = "$displayName ($accountName)"
|
fun getFullTitle() = "$displayName ($accountName)"
|
||||||
|
|
Loading…
Reference in New Issue