<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/102669/">http://git.reviewboard.kde.org/r/102669/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On September 20th, 2011, 12:17 p.m., <b>David Edmundson</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<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/102669/diff/1/?file=36521#file36521line113" style="color: black; font-weight: bold; text-decoration: underline;">src/salut-enable-dialog.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="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; ">void SalutEnableDialog::onProfileManagerReady(Tp::PendingOperation* op)</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">113</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">d</span><span class="o">-></span><span class="n">profile</span> <span class="o">=</span> <span class="n">d</span><span class="o">-></span><span class="n">profileManager</span><span class="o">-></span><span class="n">profilesForCM</span><span class="p">(</span><span class="s">"salut"</span><span class="p">).</span><span class="n">first</span><span class="p">();</span></pre></td>
</tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Be careful when using .first() and not checking the result is valid.
I can't see why it could fail, but add a Q_ASSERT for easy debugging potential future crashes.</pre>
</blockquote>
<p>On September 20th, 2011, 12:30 p.m., <b>Martin Klapetek</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Also if the list is empty, this might possibly crash.</pre>
</blockquote>
<p>On September 20th, 2011, 1:46 p.m., <b>Daniele Elmo Domenichelli</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">QList has a Q_ASSERT for that...
from qlist.h:
inline T& first() { Q_ASSERT(!isEmpty()); return *begin(); }
inline const T& first() const { Q_ASSERT(!isEmpty()); return at(0); }
</pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">QList has a Q_ASSERT for that...
from qlist.h:
inline T& first() { Q_ASSERT(!isEmpty()); return *begin(); }
inline const T& first() const { Q_ASSERT(!isEmpty()); return at(0); }
But I'll add a Q_ASSERT to check that the returned value is valid...
(sorry for the double post)</pre>
<br />
<p>- Daniele Elmo</p>
<br />
<p>On September 19th, 2011, 11:06 p.m., Daniele Elmo Domenichelli 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 Daniele Elmo Domenichelli.</div>
<p style="color: grey;"><i>Updated Sept. 19, 2011, 11:06 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;">As discussed at Woshibon 2011!
See the screenshots...
Since the patch is quite big, you can find the git branch here:
http://quickgit.kde.org/?p=clones%2Ftelepathy-accounts-kcm%2Fddomenichelli%2Ftelepathy-accounts-kcm.git&a=shortlog&h=refs/heads/salut
</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;">Added and removed accounts several times, uninstalled salut, edited parameters, and more</pre>
</td>
</tr>
</table>
<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=282198">282198</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>src/CMakeLists.txt <span style="color: grey">(c55c04622e177283007460d51593a39fccb07b55)</span></li>
<li>src/KCMTelepathyAccounts/profile-list-model.h <span style="color: grey">(63e5a16c46e6fcaa33fb4ed00d0affdb3ad8491c)</span></li>
<li>src/KCMTelepathyAccounts/profile-list-model.cpp <span style="color: grey">(c7536ab8433138273a63ddbb3fd7d37ffbd51c5f)</span></li>
<li>src/KCMTelepathyAccounts/profile-select-widget.h <span style="color: grey">(4bb92a153721b25abf44a6da52495c480fc03085)</span></li>
<li>src/KCMTelepathyAccounts/profile-select-widget.cpp <span style="color: grey">(0d5c804d25eede91b8a9ded5523e4ca9087bd8d8)</span></li>
<li>src/account-item.h <span style="color: grey">(809b93f85d111bbf13595d263faa450ff79f0073)</span></li>
<li>src/account-item.cpp <span style="color: grey">(033ac44bfed06965b8efd842d75c33fa4d8a3bb5)</span></li>
<li>src/accounts-list-model.h <span style="color: grey">(cc81c1e3e417eb8e6a35a4b8fb48205fea430452)</span></li>
<li>src/accounts-list-model.cpp <span style="color: grey">(e7bbeca9f923f21e42a06ea0a3046ed1329cc5e0)</span></li>
<li>src/kcm-telepathy-accounts.h <span style="color: grey">(6f6c3138bc39373c8b7050b2164354aabd758d07)</span></li>
<li>src/kcm-telepathy-accounts.cpp <span style="color: grey">(8d0a1cb4816055b4ddcfa8c0a377d8f1b11c0e32)</span></li>
<li>src/main-widget.ui <span style="color: grey">(1499951c28007c9166712b05df81bcb6e3ece77a)</span></li>
<li>src/salut-enable-dialog.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>src/salut-enable-dialog.cpp <span style="color: grey">(PRE-CREATION)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/102669/diff/" style="margin-left: 3em;">View Diff</a></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Screenshots </h1>
<div>
<a href="http://git.reviewboard.kde.org/r/102669/s/264/"><img src="http://git.reviewboard.kde.org/media/uploaded/images/2011/09/19/snapshot5_400x100.png" style="border: 1px black solid;" alt="Enable local-xmpp frame" /></a>
<a href="http://git.reviewboard.kde.org/r/102669/s/265/"><img src="http://git.reviewboard.kde.org/media/uploaded/images/2011/09/19/snapshot6_400x100.png" style="border: 1px black solid;" alt="Local-xmpp account enabled" /></a>
<a href="http://git.reviewboard.kde.org/r/102669/s/266/"><img src="http://git.reviewboard.kde.org/media/uploaded/images/2011/09/19/snapshot7_400x100.png" style="border: 1px black solid;" alt="Salut not found" /></a>
</div>
</td>
</tr>
</table>
</div>
</body>
</html>