<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/113289/">http://git.reviewboard.kde.org/r/113289/</a>
</td>
</tr>
</table>
<br />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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.</pre>
<br />
<p>- Dan Vrátil</p>
<br />
<p>On October 17th, 2013, 1:55 a.m. CEST, Leon Handreke wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Telepathy and Dan Vrátil.</div>
<div>By Leon Handreke.</div>
<p style="color: grey;"><i>Updated Oct. 17, 2013, 1:55 a.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="http://bugs.kde.org/show_bug.cgi?id=325957">325957</a>
</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
ktp-text-ui
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Fix logviewer crash with multiple conversations per date
This situation commonly occurs when conversations from multiple accounts
were held on a single day.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Test scenario described in the bug.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>logviewer/dates-model.cpp <span style="color: grey">(93f4814149094a84d9a822e6618599fe70df3b55)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/113289/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>