Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
bitfire web engineering
ical4android
Commits
e4c50b34
Commit
e4c50b34
authored
Oct 19, 2020
by
Ricki Hirner
🐑
Browse files
BatchOperation: explicitly allow null values
parent
2dd5100e
Pipeline
#204810273
passed with stages
in 5 minutes and 4 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
src/main/java/at/bitfire/ical4android/AndroidEvent.kt
src/main/java/at/bitfire/ical4android/AndroidEvent.kt
+4
-4
src/main/java/at/bitfire/ical4android/BatchOperation.kt
src/main/java/at/bitfire/ical4android/BatchOperation.kt
+2
-5
No files found.
src/main/java/at/bitfire/ical4android/AndroidEvent.kt
View file @
e4c50b34
...
...
@@ -819,7 +819,7 @@ abstract class AndroidEvent(
}
protected
open
fun
insertReminder
(
batch
:
BatchOperation
,
idxEvent
:
Int
,
alarm
:
VAlarm
)
{
val
builder
=
BatchOperation
.
CpoBuilder
.
newInsert
(
calendar
.
syncAdapterURI
(
Reminders
.
CONTENT_URI
))
val
builder
=
BatchOperation
.
CpoBuilder
.
newInsert
(
calendar
.
syncAdapterURI
(
Reminders
.
CONTENT_URI
))
val
method
=
when
(
alarm
.
action
?.
value
?.
toUpperCase
(
Locale
.
US
))
{
Action
.
DISPLAY
.
value
,
...
...
@@ -841,7 +841,7 @@ abstract class AndroidEvent(
}
protected
open
fun
insertAttendee
(
batch
:
BatchOperation
,
idxEvent
:
Int
,
attendee
:
Attendee
)
{
val
builder
=
BatchOperation
.
CpoBuilder
.
newInsert
(
calendar
.
syncAdapterURI
(
Attendees
.
CONTENT_URI
))
val
builder
=
BatchOperation
.
CpoBuilder
.
newInsert
(
calendar
.
syncAdapterURI
(
Attendees
.
CONTENT_URI
))
val
member
=
attendee
.
calAddress
if
(
member
.
scheme
.
equals
(
"mailto"
,
true
))
...
...
@@ -883,7 +883,7 @@ abstract class AndroidEvent(
// drop occurrences of EXT_CATEGORIES_SEPARATOR in category names
category
.
filter
{
it
!=
EXT_CATEGORIES_SEPARATOR
}
}
val
builder
=
BatchOperation
.
CpoBuilder
.
newInsert
(
calendar
.
syncAdapterURI
(
ExtendedProperties
.
CONTENT_URI
))
val
builder
=
BatchOperation
.
CpoBuilder
.
newInsert
(
calendar
.
syncAdapterURI
(
ExtendedProperties
.
CONTENT_URI
))
.
withValue
(
ExtendedProperties
.
NAME
,
EXT_CATEGORIES
)
.
withValue
(
ExtendedProperties
.
VALUE
,
rawCategories
)
...
...
@@ -897,7 +897,7 @@ abstract class AndroidEvent(
return
}
val
builder
=
BatchOperation
.
CpoBuilder
.
newInsert
(
calendar
.
syncAdapterURI
(
ExtendedProperties
.
CONTENT_URI
))
val
builder
=
BatchOperation
.
CpoBuilder
.
newInsert
(
calendar
.
syncAdapterURI
(
ExtendedProperties
.
CONTENT_URI
))
.
withValue
(
ExtendedProperties
.
NAME
,
UnknownProperty
.
CONTENT_ITEM_TYPE
)
.
withValue
(
ExtendedProperties
.
VALUE
,
UnknownProperty
.
toJsonString
(
property
))
...
...
src/main/java/at/bitfire/ical4android/BatchOperation.kt
View file @
e4c50b34
...
...
@@ -134,7 +134,7 @@ class BatchOperation(
var
selection
:
String
?
=
null
var
selectionArguments
:
Array
<
String
>?
=
null
val
values
=
mutableMapOf
<
String
,
Any
>()
val
values
=
mutableMapOf
<
String
,
Any
?
>()
val
valueBackrefs
=
mutableMapOf
<
String
,
Int
>()
...
...
@@ -156,10 +156,7 @@ class BatchOperation(
}
fun
withValue
(
key
:
String
,
value
:
Any
?):
CpoBuilder
{
if
(
value
!=
null
)
values
[
key
]
=
value
else
values
-=
key
values
[
key
]
=
value
return
this
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment