[Kde-pim] Review Request: akonadi: make itemsFromModel() support treemodels

Sergio Martins iamsergio at gmail.com
Thu Jan 28 14:56:13 GMT 2010



> On 2010-01-28 12:09:39, Sebastian Sauer wrote:
> > trunk/KDE/kdepim/korganizer/interfaces/korganizer/baseview.cpp, line 389
> > <http://reviewboard.kde.org/r/2747/diff/1/?file=17856#file17856line389>
> >
> >     I wonder a bit about the new QModelIndex() here... Are we sure that the dataChanged  is only called for the first levels of items? So, something like;
> >     
> >     Q_ASSERT(topLeft.parent() == QModelIndex() && bottomRight.parent() == QModelIndex());
> >     
> >     would not assert? If yes, then we should probably add that assert. Well, can't harm and makes it a bit more clear. If it asserts, then we do call itemsFromModel with the wrong parent and things will go wrong, or?
> >

Or maybe a less intrusive: Q_ASSERT( ( topLeft.parent() == QModelIndex() && bottomRight.parent() == QModelIndex() )
                                       || topLeft.parent() == topRight.parent() )

and passing topLeft.parent() instead of QModelIndex()


- Sergio


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


On 2010-01-28 02:36:55, Sergio Martins wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/2747/
> -----------------------------------------------------------
> 
> (Updated 2010-01-28 02:36:55)
> 
> 
> Review request for KDE PIM, Frank Osterfeld and Sebastian Sauer.
> 
> 
> Summary
> -------
> 
> korganizer is crashing when adding and editing incidences, this happens because currently itemsFromModel() (utils.cpp) only supports models were items don't have parents.
> 
> I've added support for parents and now QAbstractItemModel::rowsInserted(QModelIndex parent,int, start int end) signal is properly interpreted.
> 
> 
> This addresses bug 223729.
>     https://bugs.kde.org/show_bug.cgi?id=223729
> 
> 
> Diffs
> -----
> 
>   trunk/KDE/kdepim/akonadi/kcal/calendar.cpp 1080580 
>   trunk/KDE/kdepim/akonadi/kcal/utils.h 1080580 
>   trunk/KDE/kdepim/akonadi/kcal/utils.cpp 1080580 
>   trunk/KDE/kdepim/korganizer/interfaces/korganizer/baseview.cpp 1081262 
> 
> Diff: http://reviewboard.kde.org/r/2747/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Sergio
> 
>

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list