Review Request 110236: Remove pointless call to model index parent to count top level items

David Edmundson david at davidedmundson.co.uk
Mon Apr 29 10:39:58 UTC 2013



> On April 29, 2013, 6:57 a.m., Daniele E. Domenichelli wrote:
> > global-presence-chooser.cpp, line 95
> > <http://git.reviewboard.kde.org/r/110236/diff/1/?file=141318#file141318line95>
> >
> >     Isn't QModelIndex() and invalid index?

Yes. And the parent of a top level item is an invalid index.

If we look at rowCount we do:
if (parent.isValid) {return 0;}

we want to pass an invalid index to get the list row count.


- David


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


On April 29, 2013, 1:56 a.m., David Edmundson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110236/
> -----------------------------------------------------------
> 
> (Updated April 29, 2013, 1:56 a.m.)
> 
> 
> Review request for Telepathy.
> 
> 
> Description
> -------
> 
> Remove pointless call to model index parent to count top level items
> 
> BUG: 304085
> 
> 
> Diffs
> -----
> 
>   global-presence-chooser.cpp f5d59399a904195121ebac7266bef4176ac82bfb 
> 
> Diff: http://git.reviewboard.kde.org/r/110236/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> David Edmundson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-telepathy/attachments/20130429/b8ae8a78/attachment.html>


More information about the KDE-Telepathy mailing list