<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/112437/">http://git.reviewboard.kde.org/r/112437/</a>
</td>
</tr>
</table>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="http://git.reviewboard.kde.org/r/112437/diff/1-2/?file=186152#file186152line85" style="color: black; font-weight: bold; text-decoration: underline;">logviewer/log-viewer.cpp</a>
<span style="font-weight: normal;">
(Diff revisions 1 - 2)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">LogViewer::LogViewer(const Tp::AccountFactoryPtr &accountFactory, const Tp::ConnectionFactoryPtr &connectionFactory,</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">84</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">m_personsModel</span><span class="o">-></span><span class="n">startQuery</span><span class="p">(</span><span class="n">QList</span><span class="o"><</span><span class="n">KPeople</span><span class="o">::</span><span class="n">PersonsModelFeature</span><span class="o">></span><span class="p">()</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">82</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">m_contactsModel</span><span class="o">-></span><span class="n">setGroupMode</span><span class="p">(</span><span class="n">KTp</span><span class="o">::</span><span class="n">kpeopleEnabled</span><span class="p">()</span> <span class="o">?</span> <span class="n">KTp</span><span class="o">::</span><span class="n">ContactsModel</span><span class="o">::</span><span class="n">GroupGrouping</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Why are you doing this?
This will make parsing the original model a lot lot harder than it needs to be.
You have your own custom grouping of items anyway (see below comment), we're grouping items - then merging contacts with entity model - then grouping it again.
</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="http://git.reviewboard.kde.org/r/112437/diff/1-2/?file=186158#file186158line128" style="color: black; font-weight: bold; text-decoration: underline;">logviewer/person-entity-merge-model.cpp</a>
<span style="font-weight: normal;">
(Diff revisions 1 - 2)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">class PersonEntityMergeModel::ContactItem: public Item</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">125</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">const</span> <span class="n">QStringList</span> <span class="n">groupNames</span><span class="p">;</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">121</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">groupName</span> <span class="o">=</span> <span class="n">groupNames</span><span class="p">.</span><span class="n">isEmpty</span><span class="p">()</span> <span class="o">?</span> <span class="n">QString</span><span class="p">()</span> <span class="o">:</span> <span class="n">groupNames</span><span class="p">.</span><span class="n">first</span><span class="p">();</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I should have spotted this on the first review.
Why are you doing your own custom group grouping?
We have a working proxy model for doing this without reinventing the wheel. That one supports multiple groups properly too. This one doesn't.
It's very hard to do properly which is why I only want to do it once.
</pre>
</div>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="http://git.reviewboard.kde.org/r/112437/diff/1-2/?file=186158#file186158line532" style="color: black; font-weight: bold; text-decoration: underline;">logviewer/person-entity-merge-model.cpp</a>
<span style="font-weight: normal;">
(Diff revisions 1 - 2)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">476</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="kt">void</span> <span class="n">PersonEntityMergeModel</span><span class="o">::</span><span class="n">contactsModelRowsInserted</span><span class="p">(</span><span class="k">const</span> <span class="n">QModelIndex</span> <span class="o">&</span><span class="n">parent</span><span class="p">,</span> <span class="kt">int</span> <span class="n">start</span><span class="p">,</span> <span class="kt">int</span> <span class="n">end</span><span class="p">)</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Why has this been added in the latest revision.
Is this due to a lack of a sourceModelInitialised signal? We could have just added that in. I think I even hinted at that.
A 5 line change vs a 300 line one.</pre>
</div>
<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;">I know you're seriously pro at programming, but you don't need to go deliberately out of your way to make life difficult for yourself.
The only change I was expecting was PeronsModel model to ContactsModel (without grouping) and a few role enums.
What I want changed:
- PersonsEntityMergeModel uses the ungrouped ContactsModel
- Then use AbstractGroupingModel on the PersonsEntityMergeModel
I reckon this will halve the size of the code.. and the grouping will work better.
</pre>
<p>- David</p>
<br />
<p>On September 4th, 2013, 7:01 a.m. UTC, Dan Vrátil 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.</div>
<div>By Dan Vrátil.</div>
<p style="color: grey;"><i>Updated Sept. 4, 2013, 7:01 a.m.</i></p>
<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;">I have finished porting our beloved Log Viewer to KPeople and would like to merge it for 0.7.
The idea is that we take EntityModel (populated by entities from logger) and KPeople model and merge them into one model. This is done by an ugly beast called PersonEntityMergeModel. There is still some space for improvements (mainly performance), but generally it works and it is reasonably fast with cca 100 entities/contacts. I have also stolen code for tree view delegates from contact list, so that we are more consistent across KTp components.
Contacts are grouped by their group membership (retrieved from KPeople). When you select a Persona, dates from all subcontacts are loaded into the dates view and the Persona is expanded so that you can selected individual subcontacts.
The date picker has been replaced by a tree view with list of dates grouped by months. If there are logs from multiple subcontacts for one date, the date can be further expanded and you can pick specific subcontact.
When KPeople is disabled at build time or Nepomuk is not running, we fallback to current logviewer behavior, i.e. cntacts are grouped by accounts and display names are fetched from Telepathy (so it works only for accounts that are online).
As a new feature, the logger now has settings page which contains two tabs: one for theme configuration and one specifically for logviewer. So far it only has one option - you can pick whether you want to sort messages in logs from newest to oldest or vice versa. It's not related to KPeople, but I started working on it in the kpeople branch (don't ask me why), so there it is.</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;">Browsed some logs, seems to work :)</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>CMakeLists.txt <span style="color: grey">(8083bc2)</span></li>
<li>logviewer/CMakeLists.txt <span style="color: grey">(300ba8f)</span></li>
<li>logviewer/config/CMakeLists.txt <span style="color: grey">(PRE-CREATION)</span></li>
<li>logviewer/config/behavior-config.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>logviewer/config/behavior-config.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>logviewer/config/behavior-config.ui <span style="color: grey">(PRE-CREATION)</span></li>
<li>logviewer/config/kcm_ktp_logviewer_behavior.desktop <span style="color: grey">(PRE-CREATION)</span></li>
<li>logviewer/conversation-date-picker.h <span style="color: grey">(6e1bd60)</span></li>
<li>logviewer/conversation-date-picker.cpp <span style="color: grey">(b8db972)</span></li>
<li>logviewer/dates-model.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>logviewer/dates-model.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>logviewer/dates-view-delegate.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>logviewer/dates-view-delegate.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>logviewer/entity-filter-model.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>logviewer/entity-filter-model.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>logviewer/entity-model-item.h <span style="color: grey">(d7cb8ed)</span></li>
<li>logviewer/entity-model-item.cpp <span style="color: grey">(4e2189d)</span></li>
<li>logviewer/entity-model.h <span style="color: grey">(f9bf293)</span></li>
<li>logviewer/entity-model.cpp <span style="color: grey">(164f263)</span></li>
<li>logviewer/entity-proxy-model.h <span style="color: grey">(837f4af)</span></li>
<li>logviewer/entity-proxy-model.cpp <span style="color: grey">(b57296b)</span></li>
<li>logviewer/entity-view-delegate.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>logviewer/entity-view-delegate.cpp <span style="color: grey">(PRE-CREATION)</span></li>
<li>logviewer/entity-view.cpp <span style="color: grey">(77fefc0)</span></li>
<li>logviewer/log-viewer.h <span style="color: grey">(5820a88)</span></li>
<li>logviewer/log-viewer.cpp <span style="color: grey">(909777d)</span></li>
<li>logviewer/log-viewer.rc <span style="color: grey">(82df425)</span></li>
<li>logviewer/log-viewer.ui <span style="color: grey">(a76b34a)</span></li>
<li>logviewer/message-view.h <span style="color: grey">(4e2e2bb)</span></li>
<li>logviewer/message-view.cpp <span style="color: grey">(b037900)</span></li>
<li>logviewer/person-entity-merge-model.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>logviewer/person-entity-merge-model.cpp <span style="color: grey">(PRE-CREATION)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/112437/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>