<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/117543/">https://git.reviewboard.kde.org/r/117543/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On April 13th, 2014, 6:25 p.m. CEST, <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="https://git.reviewboard.kde.org/r/117543/diff/3/?file=265230#file265230line73" style="color: black; font-weight: bold; text-decoration: underline;">app/telepathy-chat-ui.h</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; ">public:</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">73</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">QHash</span><span class="o"><</span><span class="n">ChatTab</span><span class="o">*</span><span class="p">,</span> <span class="n">Tp</span><span class="o">::</span><span class="n">TextChannelPtr</span><span class="o">></span> <span class="n">m_textChannels</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;">I don't see the point of this map.
if you have a ChatTab you can do tab->channel().
In the one case where you loop through the values, there's no point it being in a hash. You can just do m_channelaccountMap.value()
</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;">> if you have a ChatTab you can do tab->channel().
I can't. In onTabDestroyed() I can use the pointer, because that's handler of QObject::destroyed() signal.
> In the one case where you loop through the values, there's no point it being in a hash. You can just do
> m_channelaccountMap.value()
I decided to use QHash to improve the lookup time in onGroupChatMessageReceived(), but I can turn it into QMap if you want me to.
</pre>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On April 13th, 2014, 6:25 p.m. CEST, <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="https://git.reviewboard.kde.org/r/117543/diff/3/?file=265231#file265231line91" style="color: black; font-weight: bold; text-decoration: underline;">app/telepathy-chat-ui.cpp</a>
<span style="font-weight: normal;">
(Diff revision 3)
</span>
</th>
</tr>
</thead>
<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">91</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></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;">ChatWindow has a getTab(account, contact) method
Or you can do m_channelAccountMap.contains(channel);
</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;">> ChatWindow has a getTab(account, contact) method
That's useless to me. I'm not interested in whether there's a tab with sch channel, but whether the channel is cached internally.
> Or you can do m_channelAccountMap.contains(channel);
It seems that Tp::ChannelTextPtr are only compared by value of the pointer, so unless I'm guaranteed to always get the same object via handleChannels() representing the same channel as the one I already have cached (think for instance after reconnecting to network), then I can use this, but I think that the iteration check over names is much safer (that's what ChatWindow::getTab() does)
</pre>
<br />
<p>- Dan</p>
<br />
<p>On April 13th, 2014, 4:53 p.m. CEST, Dan Vrátil 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 Dan Vrátil.</div>
<p style="color: grey;"><i>Updated April 13, 2014, 4:53 p.m.</i></p>
<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;">When "Don't leave chat room when window is closed" settings is enabled, the channel is not closed when user closes the tab or window, but is maintained by TelepathyChatUi. The channel can be left via Conversation -> Leave room action.
</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>app/chat-window.h <span style="color: grey">(72bbd1d)</span></li>
<li>app/chat-window.cpp <span style="color: grey">(a7da574)</span></li>
<li>app/telepathy-chat-ui.h <span style="color: grey">(97bc4b7)</span></li>
<li>app/telepathy-chat-ui.cpp <span style="color: grey">(33150b8)</span></li>
<li>config/behavior-config.h <span style="color: grey">(d57fd90)</span></li>
<li>config/behavior-config.cpp <span style="color: grey">(eeb3597)</span></li>
<li>config/behavior-config.ui <span style="color: grey">(c8e731c)</span></li>
<li>lib/chat-widget.cpp <span style="color: grey">(3682742)</span></li>
<li>lib/notify-filter.h <span style="color: grey">(f929ce3)</span></li>
<li>lib/notify-filter.cpp <span style="color: grey">(6807dac)</span></li>
<li>lib/text-chat-config.h <span style="color: grey">(e0ba24f)</span></li>
<li>lib/text-chat-config.cpp <span style="color: grey">(57c7c0c)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/117543/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>