https://bugs.kde.org/show_bug.cgi?id=513499

            Bug ID: 513499
           Summary: Cannot delete task dependency
    Classification: Applications
           Product: calligraplan
      Version First unspecified
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: usability
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

SUMMARY
After creating a dependency between tasks, it cannot be deleted.

STEPS TO REPRODUCE
1. Create more than two tasks.
2. Create a dependency between the tasks using the "Link" button.
3. Add a link to a task other than the one chosen by default and close the
dependency editor with "OK".
4. Reopen the dependency editor using the "Link" button.
5. Select the existing relation and click the delete button (or hit Del).
6. Close the editor with "OK".
7. Reopen the link editor.

OBSERVED RESULT
The deleted link still exists.

EXPECTED RESULT
The link has been deleted and a default link is shown instead.

SOFTWARE/OS VERSIONS
All 

ADDITIONAL INFORMATION
To distinguish the incorrect behavior from the intended behavior, it's
important to create a link to a task other than the one chosen by default.
Alternatively, create links to more than one task. After deleting any, they all
remain.

I traced down the issue to the incorrect item role being selected when updating
the model item in `RelationEditorDialog::removeRelation()`. Instead of using
the default in the second argument to `item->setData`, using `TASKDELETED_ROLE`
fixes the problem. To resolve the issue, change line 365 of
`calligraplan/src/libs/ui/RelationEditorDialog.cpp` to:
```item->setData(false, TASKDELETED_ROLE);```
and line 372 to:
```item->setData(true, TASKDELETED_ROLE);```
For reference:
https://github.com/KDE/calligraplan/blob/8bf7f73431fdd8640ab92b7081c9c8496e10ebcc/src/libs/ui/RelationEditorDialog.cpp#L365

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to