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

Unverified Commit f5e56be8 authored by Marten Gajda's avatar Marten Gajda Committed by GitHub
Browse files

Update task relationships when updating PARENT_ID, implements #454 (#933)

PARENT_ID was meant to serve as a shortcut to parent-child relationships between tasks, for both writing and reading.
While the reading part already works (with the exception of issue #877) the writing part didn't work yet. This is fixed by this commit.
parent d31a1918
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -795,6 +795,13 @@ public final class TaskContract
        /**
         * The row id of the parent task. <code>null</code> if the task has no parent task.
         * <p>
         * Note, when writing this value the task {@link Property.Relation} properties are updated accordingly. Any parent or child relations which
         * make this a child of another task are deleted and a new {@link Property.Relation#RELTYPE_PARENT} relation pointing to the new parent is created.
         * Be aware that Siblings will be split, i.e. they are not moved to the new parent. Currently this might cause siblings to become orphans if they
         * don't have a parent-child relationship. This behavior may change in future version.
         * </p>
         *
         * <p>
         * Value: Long
         * </p>
         */
+392 −0

File added.

Preview size limit exceeded, changes collapsed.

+2 −1
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ import org.dmfs.provider.tasks.processors.tasks.Instantiating;
import org.dmfs.provider.tasks.processors.tasks.Moving;
import org.dmfs.provider.tasks.processors.tasks.Originating;
import org.dmfs.provider.tasks.processors.tasks.Relating;
import org.dmfs.provider.tasks.processors.tasks.Reparenting;
import org.dmfs.provider.tasks.processors.tasks.Searchable;
import org.dmfs.provider.tasks.processors.tasks.TaskCommitProcessor;
import org.dmfs.provider.tasks.processors.tasks.Validating;
@@ -186,7 +187,7 @@ public final class TaskProvider extends SQLiteContentProvider implements OnAccou
        mAuthority = AuthorityUtil.taskAuthority(getContext());

        mTaskProcessorChain = new Validating(
                new AutoCompleting(new Relating(new Instantiating(new Searchable(new Moving(new Originating(new TaskCommitProcessor())))))));
                new AutoCompleting(new Relating(new Reparenting(new Instantiating(new Searchable(new Moving(new Originating(new TaskCommitProcessor()))))))));

        mListProcessorChain = new org.dmfs.provider.tasks.processors.lists.Validating(new ListCommitProcessor());

+5 −0
Original line number Diff line number Diff line
@@ -81,6 +81,11 @@ public interface TaskAdapter extends EntityAdapter<TaskAdapter>
     */
    BooleanFieldAdapter<TaskAdapter> ORIGINAL_INSTANCE_ALLDAY = new BooleanFieldAdapter<TaskAdapter>(Tasks.ORIGINAL_INSTANCE_ALLDAY);

    /**
     * Adapter for the parent_id of a task.
     */
    LongFieldAdapter<TaskAdapter> PARENT_ID = new LongFieldAdapter<TaskAdapter>(Tasks.PARENT_ID);

    /**
     * Adapter for the all day flag of a task.
     */
+119 −0

File added.

Preview size limit exceeded, changes collapsed.