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



 <p>Ship it!</p>









<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="https://git.reviewboard.kde.org/r/116559/diff/3/?file=251890#file251890line275" style="color: black; font-weight: bold; text-decoration: underline;">lib/adium-theme-view.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 AdiumThemeView::initialise(const AdiumThemeHeaderInfo &chatInfo)</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">275</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="n">QRegExp</span> <span class="nf">body</span><span class="p">(</span><span class="n">QLatin1String</span><span class="p">(</span><span class="s">"<body[^>]*(onload=</span><span class="se">\"</span><span class="s">([^</span><span class="se">\"</span><span class="s">]*)</span><span class="se">\"</span><span class="s">)?[^>]*>"</span><span class="p">),</span> <span class="n">Qt</span><span class="o">::</span><span class="n">CaseInsensitive</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;">document this so that future you can understand it and why.

Especially the regex. No-one likes reverse engineering them.</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;">Can you make sure you test:
 - the log viewer
 - changing the theme during an active chat</pre>

<p>- David Edmundson</p>


<br />
<p>On March 4th, 2014, 5:25 a.m. UTC, Diane Trout wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://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 Diane Trout.</div>


<p style="color: grey;"><i>Updated March 4, 2014, 5:25 a.m.</i></p>







<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=325183">325183</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
ktp-text-ui
</div>


<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;">What I discovered is that occasionally the AdiumThemeView will fire its loadFinished event before the body has finished loading. (which also means that some of the javascript functions don't get defined as they're created from the onLoad property of body.

What this patch does is injects a small proxy QObject (AdiumThemeViewProxy) into the javascript environment in AdiumThemeView::injectProxyIntoJavascript(). The proxy gives javascript access to a signal that it can call at the end of a new "configureEnvironment" javascript function. 

I added the new function instead of adding the signal to the end of the current initStyles functions because that appears to be overridable by some of the themes.

Also since this now lets you definitavely know that javascript is ready to append your messages, I removed some extra sendDemoMessages calls. 

I'm not sure what happens if a theme tries to override data/Template.html though.

Also I stuck AdiumThemeViewProxy in with the AdiumThemeView because it seemed small and tightly coupled with AdiumThemeView. However it seems like the convention is every class gets its own .h/.cpp file. So that might need to be fixed.</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;">Set message style to Renkoo for both normal chat and group chat.

closed ktp-text-ui. 
reloaded ktp-text-ui. 
loaded configuration dialog. Clicked on both tabs. checked that they both rendered
close configuration dialog.
repeat opening the configuration dialog box and checking both tabs a few times.

Before the patch usually at least one of the tabs wouldn't render. It was somewhat random which one wouldn't render, and occasionally they both would render correctly.

I tried multiple times post patch and have yet to see it fail.</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>lib/adium-theme-view.h <span style="color: grey">(8d17f9d)</span></li>

 <li>lib/adium-theme-view.cpp <span style="color: grey">(635a877)</span></li>

 <li>config/appearance-config-tab.cpp <span style="color: grey">(ffef4f6)</span></li>

</ul>

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







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








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