<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/?file=186128#file186128line352" style="color: black; font-weight: bold; text-decoration: underline;">lib/adium-theme-view.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </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; ">void AdiumThemeView::setHeaderDisplayed(bool displayHeader)</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">352</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="k"><span class="hl">if</span></span><span class="hl"> </span><span class="p"><span class="hl">(</span></span><span class="o"><span class="hl">!</span></span><span class="n">page</span><span class="p">()</span><span class="o">-></span><span class="n">mainFrame</span><span class="p">()</span><span class="o">-></span><span class="n"><span class="hl">url</span></span><span class="p"><span class="hl">().</span></span><span class="n"><span class="hl">isEmpty</span></span><span class="p">())</span><span class="hl"> </span><span class="p"><span class="hl">{</span></span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">352</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">page</span><span class="p">()</span><span class="o">-></span><span class="n">mainFrame</span><span class="p">()</span><span class="o">-></span><span class="n"><span class="hl">setHtml</span></span><span class="p"><span class="hl">(</span></span><span class="n"><span class="hl">QString</span></span><span class="p">())<span class="hl">;</span></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?
I imagine this is a bad merge.</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/?file=186146#file186146line201" style="color: black; font-weight: bold; text-decoration: underline;">logviewer/entity-model.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </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; ">int EntityModel::columnCount(const QModelIndex &parent) const</pre></td>

  </tr>
 </tbody>



 
 

 <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">153</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cp">#ifdef HAVE_KPEOPLE</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;">You don't need the #ifdef here

kpeopleEnabled will always return false if that's the case.</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/?file=186146#file186146line206" style="color: black; font-weight: bold; text-decoration: underline;">logviewer/entity-model.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </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; ">int EntityModel::columnCount(const QModelIndex &parent) const</pre></td>

  </tr>
 </tbody>



 
 

 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">184</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="n">pendingEntities</span><span class="o">-></span><span class="n">account</span><span class="p">()</span><span class="o">-></span><span class="n">connection</span><span class="p">()</span><span class="o">-></span><span class="n">contactManager</span><span class="p">()</span><span class="o">-></span><span class="n">contactsForIdentifiers</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">158</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span class="n">pendingEntities</span><span class="o">-></span><span class="n">account</span><span class="p">()</span><span class="o">-></span><span class="n">connection</span><span class="p">()</span><span class="o">-></span><span class="n">contactManager</span><span class="p">()</span><span class="o">-></span><span class="n">contactsForIdentifiers</span><span class="p">(</span><span class="n">ids</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;">if you're offline you now crash.

Proposal:
Given this whole code is rather confusing in places, I have the following idea:

You change your MergeModel to always merge with ContactsModel. 
You can then drop this code here which is fetching contact names, and a lot of other #ifdefs inside the EntityModel. I think it would be mostly the same except a few role names changing.
In non kpeople mode we'll be fetching from the regular contact list.

The only thing that I think makes this difficult is we need a modelInitialised signal on the normal model, but I can fix that.

Thoughts?
</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/?file=186152#file186152line35" style="color: black; font-weight: bold; text-decoration: underline;">logviewer/log-viewer.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>



 
 

 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">35</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cp">#include <<span class="hl">QSortFilterProxyM</span>odel></span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">35</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cp">#include <<span class="hl">kpeople/personsm</span>odel<span class="hl">.h</span>></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;">needs #ifdef</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/?file=186152#file186152line85" style="color: black; font-weight: bold; text-decoration: underline;">logviewer/log-viewer.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </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="#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">83</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">m_personsModel</span> <span class="o">=</span> <span class="k">new</span> <span class="n">KPeople</span><span class="o">::</span><span class="n">PersonsModel</span><span class="p">(</span><span class="k">this</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;">We can't use KPeople without #ifdefs in the log viewer.

</pre>
</div>
<br />



<p>- David</p>


<br />
<p>On September 1st, 2013, 8:48 p.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. 1, 2013, 8:48 p.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>lib/adium-theme-view.cpp <span style="color: grey">(635a877)</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/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>