Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
DAVx⁵
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
bitfire web engineering
DAVx⁵
Commits
50bd1198
Commit
50bd1198
authored
Mar 24, 2018
by
Ricki Hirner
🐑
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't re-schedule non-existent master events of deleted exceptions
parent
c1f3165f
Pipeline
#19437338
passed with stages
in 6 minutes and 25 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
app/src/main/java/at/bitfire/davdroid/resource/LocalCalendar.kt
...c/main/java/at/bitfire/davdroid/resource/LocalCalendar.kt
+13
-10
build.gradle
build.gradle
+1
-1
No files found.
app/src/main/java/at/bitfire/davdroid/resource/LocalCalendar.kt
View file @
50bd1198
...
...
@@ -153,7 +153,7 @@ class LocalCalendar private constructor(
"${Events.CALENDAR_ID}=? AND ${Events.DELETED}!=0 AND ${Events.ORIGINAL_ID} IS NOT NULL"
,
arrayOf
(
id
.
toString
()),
null
)
?.
use
{
cursor
->
while
(
cursor
.
moveToNext
())
{
Logger
.
log
.
fine
(
"Found deleted exception, removing
; then re-scheduling original event
"
)
Logger
.
log
.
fine
(
"Found deleted exception, removing
and re-scheduling original event (if available)
"
)
val
id
=
cursor
.
getLong
(
0
)
// can't be null (by definition)
val
originalID
=
cursor
.
getLong
(
1
)
// can't be null (by query)
...
...
@@ -164,17 +164,20 @@ class LocalCalendar private constructor(
syncAdapterURI
(
ContentUris
.
withAppendedId
(
Events
.
CONTENT_URI
,
originalID
)),
arrayOf
(
LocalEvent
.
COLUMN_SEQUENCE
),
null
,
null
,
null
)
?.
use
{
cursor2
->
val
originalSequence
=
if
(
cursor2
.
isNull
(
0
))
0
else
cursor2
.
getInt
(
0
)
// re-schedule original event and set it to DIRTY
batch
.
enqueue
(
BatchOperation
.
Operation
(
ContentProviderOperation
.
newUpdate
(
syncAdapterURI
(
ContentUris
.
withAppendedId
(
Events
.
CONTENT_URI
,
originalID
)))
.
withValue
(
LocalEvent
.
COLUMN_SEQUENCE
,
originalSequence
+
1
)
.
withValue
(
Events
.
DIRTY
,
1
)
))
if
(
cursor2
.
moveToNext
())
{
// original event is available
val
originalSequence
=
if
(
cursor2
.
isNull
(
0
))
0
else
cursor2
.
getInt
(
0
)
// re-schedule original event and set it to DIRTY
batch
.
enqueue
(
BatchOperation
.
Operation
(
ContentProviderOperation
.
newUpdate
(
syncAdapterURI
(
ContentUris
.
withAppendedId
(
Events
.
CONTENT_URI
,
originalID
)))
.
withValue
(
LocalEvent
.
COLUMN_SEQUENCE
,
originalSequence
+
1
)
.
withValue
(
Events
.
DIRTY
,
1
)
))
}
}
//
remove
exception
//
completely remove deleted
exception
batch
.
enqueue
(
BatchOperation
.
Operation
(
ContentProviderOperation
.
newDelete
(
syncAdapterURI
(
ContentUris
.
withAppendedId
(
Events
.
CONTENT_URI
,
id
)))
))
...
...
build.gradle
View file @
50bd1198
...
...
@@ -9,7 +9,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript
{
ext
.
dokka_version
=
'0.9.15'
ext
.
kotlin_version
=
'1.2.3
0
'
ext
.
kotlin_version
=
'1.2.3
1
'
repositories
{
jcenter
()
...
...
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