----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/113289/#review41866 -----------------------------------------------------------
If parent index is a date, then internalId() contains index of the parent row. If parent index is a conversation (leaf node), then internalId is pointer to parent Date struct. This means that parent.internalId() >= 0 is true in both cases above, so restricting the upper boundary for dates makes sense. The code relies on a very bold assertion, that there will never be enough dates in one group for the number to reach a value of a pointer, and that system will never allocate pointer on address low enough to intersect with the dates. I admit that I was very stupid and lazy when writing this code and I don't deserve a sweet after lunch today. A proper approach would probably be to have a Node class, and Date and Account subclasses of Node, so that we could only use pointers in QModelIndex::internalPointer and thus avoid the craziness above. Leon, are you willing to take a look into properly fixing the model? Otherwise ship this, and I'll rewrite the model tomorrow over the weekend. - Dan Vrátil On Oct. 17, 2013, 1:55 a.m., Leon Handreke wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://git.reviewboard.kde.org/r/113289/ > ----------------------------------------------------------- > > (Updated Oct. 17, 2013, 1:55 a.m.) > > > Review request for Telepathy and Dan Vrátil. > > > Bugs: 325957 > http://bugs.kde.org/show_bug.cgi?id=325957 > > > Repository: ktp-text-ui > > > Description > ------- > > Fix logviewer crash with multiple conversations per date > > This situation commonly occurs when conversations from multiple accounts > were held on a single day. > > > Diffs > ----- > > logviewer/dates-model.cpp 93f4814149094a84d9a822e6618599fe70df3b55 > > Diff: http://git.reviewboard.kde.org/r/113289/diff/ > > > Testing > ------- > > Test scenario described in the bug. > > > Thanks, > > Leon Handreke > >
_______________________________________________ KDE-Telepathy mailing list [email protected] https://mail.kde.org/mailman/listinfo/kde-telepathy
