<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/103302/">http://git.reviewboard.kde.org/r/103302/</a>
</td>
</tr>
</table>
<br />
<p>Ship it!</p>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">That's what I am talking about dude, yes. Thanks for that. But please, watch out for whitespaces: they're all over.</pre>
<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/103302/diff/1/?file=42545#file42545line56" style="color: black; font-weight: bold; text-decoration: underline;">KTelepathy/Models/accounts-filter-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; ">bool AccountsFilterModel::showOfflineUsers() const</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">56</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="kt"><span class="hl">int</span></span><span class="hl"> </span><span class="n"><span class="hl">type</span></span><span class="hl"> </span><span class="o"><span class="hl">=</span></span><span class="hl"> </span><span class="n">index</span><span class="p">.</span><span class="n">data</span><span class="p">(</span><span class="n">AccountsModel</span><span class="o">::</span><span class="n"><span class="hl">Item</span>Role</span><span class="p">).</span><span class="n"><span class="hl">userType</span></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">56</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k"><span class="hl">switch</span></span><span class="p"><span class="hl">(</span></span><span class="n">index</span><span class="p">.</span><span class="n">data</span><span class="p">(</span><span class="n">AccountsModel</span><span class="o">::</span><span class="n"><span class="hl">Type</span>Role</span><span class="p">).</span><span class="n"><span class="hl">toInt</span></span><span class="p"><span class="hl">())</span></span><span class="hl"> </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;">code style: switch (</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/103302/diff/1/?file=42545#file42545line57" style="color: black; font-weight: bold; text-decoration: underline;">KTelepathy/Models/accounts-filter-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; ">bool AccountsFilterModel::showOfflineUsers() const</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">57</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">if</span> <span class="p">(</span><span class="n">type</span> <span class="o">==</span> <span class="n">qMetaTypeId</span><span class="o"><</span><span class="n">ContactModelItem</span><span class="o">*></span><span class="p">())</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">57</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="ew"> </span></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">58</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">case</span> <span class="n">AccountsModel</span><span class="o">::</span><span class="nl">ContactType:</span><span class="ew"> </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;">Watch out for whitespaces</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/103302/diff/1/?file=42547#file42547line152" style="color: black; font-weight: bold; text-decoration: underline;">KTelepathy/Models/accounts-model.h</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="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">Q_DECLARE_METATYPE(Tp::AccountPtr);</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">149</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="c1">//FIXME, these need including, but I'm not sure where - I'm thinking we maybe need a types.h file in the main lib for all enums and such.</span></pre></td>
</tr>
<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">150</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="n">Q_DECLARE_METATYPE</span><span class="p">(</span><span class="n">Tp</span><span class="o">::</span><span class="n">ContactPtr</span><span class="p">);</span></pre></td>
</tr>
<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">151</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="n">Q_DECLARE_METATYPE</span><span class="p">(</span><span class="n">Tp</span><span class="o">::</span><span class="n">AccountPtr</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 are going for the types.h approach, which I favor, you would then move metatype decls there</pre>
</div>
<br />
<p>- Dario</p>
<br />
<p>On December 1st, 2011, 2:16 a.m., David Edmundson wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Telepathy.</div>
<div>By David Edmundson.</div>
<p style="color: grey;"><i>Updated Dec. 1, 2011, 2:16 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;">This is the first patch in making it so we don't need to export ContactModelItem, AccountModelItem, TreeNode, ProxyTreeNode, GrouModelItem in our lib.
These classes get in the way of a port to the nepomuk model. The only uses for them is to get to a ContactPtr or AccountPtr, and it involves having to publicly expose a lot of internal classes in our library.
With this done, the code in the Contact List will be a lot less model dependant (as we won't have to proxy through these classes) it will also have a lot smaller and simpler.
This patch
- Adds roles to get a Tp::ContactPtr and Tp::AccountPtr directly.
- Expose a role to return the type of current index (i.e Account, Contact or Group) so we can use that instead of checking the QVariant type on ItemRole.
- Also adds exposure to get the relevant AccountPtr from a contact, rather than having to call an extra method on AccountsModel which again makes code simpler.
- this patch also introduces an asynchronous setting of a Tp::AccountManager on the model. This was needed to fix up the contact-list-applet.
The next step is to rewrite the contact list to not use ItemRole.
ItemRole has not been removed yet, as there is a /lot/ of code to update, so I'm doing it in four phases.
1) Expose the new information we need
2+3) Update everything to use ContactRole/AccountRole (both contact list, and groups-model.cpp need heavy updating)
4) Get rid of the old interface.</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>KTelepathy/Models/accounts-filter-model.cpp <span style="color: grey">(ca7aa91)</span></li>
<li>KTelepathy/Models/accounts-model-item.cpp <span style="color: grey">(db1d98f)</span></li>
<li>KTelepathy/Models/accounts-model.h <span style="color: grey">(12f2438)</span></li>
<li>KTelepathy/Models/accounts-model.cpp <span style="color: grey">(355ee95)</span></li>
<li>KTelepathy/Models/contact-model-item.cpp <span style="color: grey">(d87e21f)</span></li>
<li>KTelepathy/Models/groups-model-item.cpp <span style="color: grey">(9a88788)</span></li>
<li>KTelepathy/Models/groups-model.h <span style="color: grey">(d3cd282)</span></li>
<li>KTelepathy/Models/groups-model.cpp <span style="color: grey">(2827e86)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/103302/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>