Bug 277297 - "Add Task" adds task in wrong place
Summary: "Add Task" adds task in wrong place
Status: RESOLVED FIXED
Alias: None
Product: kplato
Classification: Miscellaneous
Component: general (show other bugs)
Version: 2.3
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Dag Andersen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-07 12:43 UTC by DGardner
Modified: 2011-07-08 12:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description DGardner 2011-07-07 12:43:44 UTC
Version:           2.3 (using KDE 4.6.3) 
OS:                Linux

I'm using KPlato 0.10.3 for KOffice 2.3.3 on Fedora 15 (64-bit).

If I create a tree of tasks and hit the "Add Task" toolbar button, the new task is often added in an unexpected location and the task tree is collapsed.

Reproducible: Always

Steps to Reproduce:
Create two summary tasks and one sub-task in each and expand the task tree fully.

Select the sub-task of the first summary task with the mouse pointer and then move the focus to the sub-task of the second summary task using the arrow keys on the keyboard.

Click on the "Add Task" toolbar button.

Actual Results:  
The task tree is collapsed and the new task is added as a sibling of the summary tasks, not as a sibling of the second sub-task.

Expected Results:  
The new task should be a sibling of whatever task has the focus. Yes, I know, "Press the Space Bar to turn the focus into a selection," but I didn't see that mentioned in the "KPlato Handbook" ;-)

Regardless of the Space Bar, to me it looks like I have selected/focussed a different task and I expect the new task to be a sibling of that one, not a sibling of some lost selection or a new child of the project if there is a focussed task, but no selected task.

Is there any explanation for the current behaviour that would make sense to me? I've seen it in a few KDE apps, where it might be related to making selections with the keyboard. However, if there is no selection, would it ever be wrong to assume that the focussed task is what the user wants to operate upon?
Comment 1 DGardner 2011-07-07 13:28:29 UTC
I just noticed that I get this message in the terminal window when I add a task as described above:

  "kplato(3804): Ooops, no parent and no project found"
Comment 2 Dag Andersen 2011-07-08 12:18:46 UTC
Git commit 0deb03ffc8d4a76bb5f63b8977f05a2b0815b72d by Dag Andersen.
Committed on 08/07/2011 at 14:13.
Pushed by danders into branch 'master'.

Task editor: improve selection strategy

Try hard to always have current index also selected.
This makes it easier for the user to see where new nodes
will be inserted.
BUG:277297

M  +1    -0    kplato/libs/models/kptnodeitemmodel.cpp     
M  +2    -1    kplato/libs/models/kptnodeitemmodel.h     
M  +64   -11   kplato/libs/ui/kpttaskeditor.cpp     
M  +2    -1    kplato/libs/ui/kpttaskeditor.h     
M  +21   -1    kplato/libs/ui/kptviewbase.cpp     
M  +1    -0    kplato/libs/ui/kptviewbase.h     

http://commits.kde.org/calligra/0deb03ffc8d4a76bb5f63b8977f05a2b0815b72d