Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 89d7873d authored by Ricki Hirner's avatar Ricki Hirner Committed by GitHub
Browse files

jtx Collection: allow to read supportsVEVENT, supportsVTODO, supportsVJOURNAL from db (#29)

parent 7b4394bb
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -48,6 +48,10 @@ open class JtxCollection<out T: JtxICalObject>(val account: Account,
    var displayname: String? = null
    var syncstate: String? = null

    var supportsVEVENT = true
    var supportsVTODO = true
    var supportsVJOURNAL = true

    var context: Context? = null


@@ -56,7 +60,6 @@ open class JtxCollection<out T: JtxICalObject>(val account: Account,
    }

    fun update(values: ContentValues) {

        client.update(ContentUris.withAppendedId(JtxContract.JtxCollection.CONTENT_URI.asSyncAdapter(account), id), values, null, null)
    }

@@ -65,6 +68,10 @@ open class JtxCollection<out T: JtxICalObject>(val account: Account,
        displayname = values.getAsString(JtxContract.JtxCollection.DISPLAYNAME)
        syncstate = values.getAsString(JtxContract.JtxCollection.SYNC_VERSION)

        supportsVEVENT = values.getAsBoolean(JtxContract.JtxCollection.SUPPORTSVEVENT)
        supportsVTODO = values.getAsBoolean(JtxContract.JtxCollection.SUPPORTSVTODO)
        supportsVJOURNAL = values.getAsBoolean(JtxContract.JtxCollection.SUPPORTSVJOURNAL)

        this.context = context
    }

+106 −107
Original line number Diff line number Diff line
@@ -1386,7 +1386,6 @@ duration?.let(props::add)
     * @param [values] The Content Values with the information about the JtxICalObject
     */
    fun populateFromContentValues(values: ContentValues) {

            values.getAsLong(JtxContract.JtxICalObject.ID)?.let { id -> this.id = id }

            values.getAsString(JtxContract.JtxICalObject.COMPONENT)?.let { component -> this.component = component }