Review Request 111751: Refresh TaskStatusItemModel when a Node changes

Alvaro Soliverez asoliverez at kde.org
Mon Jul 29 00:03:51 BST 2013



> On July 28, 2013, 7 p.m., Friedrich W. H. Kossebau wrote:
> > plan/libs/models/kpttaskstatusmodel.cpp, line 724
> > <http://git.reviewboard.kde.org/r/111751/diff/1/?file=174019#file174019line724>
> >
> >     If calling "refresh()" at the end anyway, then all the logic with the row before and emitting dataChanged is unneeded, from what I understand of the rest of the code.
> >     
> >     Ideally the "TaskStatusItemModel::slotNodeChanged(...)" method would have some additional logic which checks if the task is still in the same group. Possibly there could be a private enum listing all the groups ("TaskStatus {TaskStarted, TaskRunning, TaskUpcoming, TaskNotStarted }") and a separate, private method which estimates the group for a given task ("TaskStatus TaskStatusItemModel::statusOfNode( Node *node )"). The latter would have the code to estimate the group just taken from "TaskStatusItemModel::refresh()" which would after that then use "TaskStatusItemModel::statusOfNode(...)" instead.
> >     With that "TaskStatusItemModel::slotNodeChanged( Node *node )" could use "TaskStatusItemModel::statusOfNode(...)" to see if the new status matches the old one known, and in the case it does not go and call "refresh()", but in all other cases just emit dataChanged() as before.
> >     To get the proper group via the enum it needs to be ensured that the order of the groups in "QList <KPlato::NodeMap* > m_top" matches the value of the status in the enum, so "m_top[status]" will get it.
> >     
> >     Got what I mean?

I see what you mean, and I'd just drop all that code and call refresh(), because it doesn't cover the case where a node is not in any group (eg. a task that was supposed to start after next period).


- Alvaro


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/111751/#review36677
-----------------------------------------------------------


On July 27, 2013, 8:58 p.m., Alvaro Soliverez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/111751/
> -----------------------------------------------------------
> 
> (Updated July 27, 2013, 8:58 p.m.)
> 
> 
> Review request for Calligra.
> 
> 
> Description
> -------
> 
> When updating progress of a task, the Task Status view does not refresh accordingly. If the task was already in the view (it shows tasks only within a timeframe or tasks in progress), it will not change groups if the task changes status. If the task was not in the view, and for example, it is set to started, it will not show up in the view.
> 
> call refresh() after slotNodeChanged()
> 
> 
> This addresses bug 322897.
>     http://bugs.kde.org/show_bug.cgi?id=322897
> 
> 
> Diffs
> -----
> 
>   plan/libs/models/kpttaskstatusmodel.cpp 6257ea3 
> 
> Diff: http://git.reviewboard.kde.org/r/111751/diff/
> 
> 
> Testing
> -------
> 
> Tested with a live file, now it refreshes correctly in both cases
> 
> 
> Thanks,
> 
> Alvaro Soliverez
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20130728/3f7c2b41/attachment.htm>


More information about the calligra-devel mailing list