<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/107246/">http://git.reviewboard.kde.org/r/107246/</a>
     </td>
    </tr>
   </table>
   <br />








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On November 9th, 2012, 3:08 p.m., <b>Daniele Elmo Domenichelli</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/107246/diff/3/?file=94492#file94492line397" style="color: black; font-weight: bold; text-decoration: underline;">src/kcm-telepathy-accounts.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 3)

    </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 KCMTelepathyAccounts::onEditIdentityClicked()</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">397</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">KDialog</span> <span class="o">*</span><span class="n">dialog</span> <span class="o">=</span> <span class="k">new</span> <span class="n">KDialog</span><span class="p">(</span><span class="k">this</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;">For some reason I don't remember, I think that krazy gives a warning when you do this, you should use instead QWeakPointer<KDialog>
Have a look at this: http://quickgit.kde.org/index.php?p=ktp-accounts-kcm.git&a=commitdiff&h=ddc8b8f91a0623ae11910f468b3f7ffc7dc0a27b</pre>
 </blockquote>



 <p>On November 9th, 2012, 3:57 p.m., <b>Dan Vrátil</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;">In this case ownership of the dialog is transferred to KMessageBox::createKMessageBox() (l. 402), so the weakpointer would be of no help here.</pre>
 </blockquote>





 <p>On November 9th, 2012, 4:06 p.m., <b>David Edmundson</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;">You're absolutely right. 

In which case I would suggest:
KDialog *dialog = new KDialog(0); //ownership is passed to KMessageBox::createMessageBox();</pre>
 </blockquote>





 <p>On November 9th, 2012, 4:23 p.m., <b>Dan Vrátil</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;">Sorry, "ownership" is not what I meant :) The dialog should still be owned by KCMTelepathyAccounts, what KMessageBox::createKMessageBox() does is that it wraps it in QPointer before calling exec(), thus making sure that it does not crash when parent is deleted:

QPointer<KDialog> guardedDialog = dialog;
const int result = guardedDialog->exec();
....
delete (KDialog *) guardedDialog;</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;">Oh I didn't know that... But perhaps that crazy will spot that anyway. In case we can suppress crazy warning later.
Anyway a comment "KDialog *dialog = new KDialog(this); // this is deleted later by createKMessageBox" might be useful, or someone (for example me as soon as I forget about this) might add "delete dialog;" :P</pre>
<br />




<p>- Daniele Elmo</p>


<br />
<p>On November 9th, 2012, 2 p.m., Dan Vrátil 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 Dan Vrátil.</div>


<p style="color: grey;"><i>Updated Nov. 9, 2012, 2 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;">When you add a new account in the KCM, it will search for corresponding Kopete logs and ask whether to import them (and eventually import them).


Bonus points for me: when you remove an account, you will be prompted whether you want to remove logs as well.</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 account I had on Kopete to KTp, got prompted whether to import logs, confirmed, logs imported.
Removed account, got prompted whether to clear logs, confirmed, logs gone.</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">(b4248fb)</span></li>

 <li>src/CMakeLists.txt <span style="color: grey">(ee82fd0)</span></li>

 <li>src/kcm-telepathy-accounts.h <span style="color: grey">(29629eb)</span></li>

 <li>src/kcm-telepathy-accounts.cpp <span style="color: grey">(6389a67)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/107246/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>