[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Review Request 128664: Nested tags for Baloo
From: Vishesh Handa <me () vhanda ! in>
Date: 2016-08-19 8:51:11
Message-ID: 20160819085111.20316.32150 () mimi ! kde ! org
[Download RAW message or body]
--===============1713656492104611765==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/128664/#review98494
-----------------------------------------------------------
This is quite an interesting change.
Could you please also elaborate on how this will change the tags kioslave? I'm afraid \
I don't quite follow.
src/kioslaves/tags/kio_tags.cpp (line 103)
<https://git.reviewboard.kde.org/r/128664/#comment66370>
QString::compare returns 0 on match or < 0 and > 0 depending on which term is \
larger. I don't quite understand what is going on over here.
src/kioslaves/tags/kio_tags.cpp (line 395)
<https://git.reviewboard.kde.org/r/128664/#comment66369>
This code is getting hard to follow. Do you think you could write a simple unit \
test for just this function?
That way it will be clear what inputs it can accept.
Also I think this function can be made `const`.
src/lib/searchstore.cpp (line 58)
<https://git.reviewboard.kde.org/r/128664/#comment66367>
I think this line along with the next can now be removed.
src/lib/searchstore.cpp (line 270)
<https://git.reviewboard.kde.org/r/128664/#comment66366>
Please check for both "tag" and "tags".
src/lib/searchstore.cpp (line 276)
<https://git.reviewboard.kde.org/r/128664/#comment66368>
Could you please explain what's going on over here? I don't understand it.
From a cursory glance it seems that this code will assert. `q` is of type \
`EngineQuery::Phrase` and is a leaf query so `Transaction::PostingIterator` will \
assert it `Q_ASSERT(0)`
- Vishesh Handa
On Aug. 18, 2016, 11:56 p.m., James Smith wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128664/
> -----------------------------------------------------------
>
> (Updated Aug. 18, 2016, 11:56 p.m.)
>
>
> Review request for Baloo and Vishesh Handa.
>
>
> Bugs: 334615
> http://bugs.kde.org/show_bug.cgi?id=334615
>
>
> Repository: baloo
>
>
> Description
> -------
>
> Index and query each tag as a single full term for generating recursed search \
> results. Represent nested tags as recursed items in the Tags:// KIO Slave.
>
> Diffs
> -----
>
> src/file/basicindexingjob.cpp 88bb59a01e5592abb74b1ab345bfc6765d35db57
> src/kioslaves/tags/kio_tags.cpp de2e6d71945632e23a85f831878b4c431360731c
> src/lib/searchstore.cpp 060a4fd795ab858eb84526f93f827d09ee85db7c
>
> Diff: https://git.reviewboard.kde.org/r/128664/diff/
>
>
> Testing
> -------
>
> Compile, run
>
>
> Thanks,
>
> James Smith
>
>
--===============1713656492104611765==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 7bit
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;"> \
<tr> <td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/128664/">https://git.reviewboard.kde.org/r/128664/</a>
</td>
</tr>
</table>
<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;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This \
is quite an interesting change.</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">Could you please also \
elaborate on how this will change the tags kioslave? I'm afraid I don't quite \
follow.</p></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="https://git.reviewboard.kde.org/r/128664/diff/1/?file=474469#file474469line104" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/kioslaves/tags/kio_tags.cpp</a> <span style="font-weight: normal;">
(Diff revision 1)
</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">103</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> \
<span class="k">if</span> <span class="p">(</span><span \
class="n">resultTag</span><span class="p">.</span><span \
class="n">startsWith</span><span class="p">(</span><span class="n">tag</span><span \
class="p">,</span> <span class="n">Qt</span><span class="o">::</span><span \
class="n">CaseInsensitive</span><span class="p">)</span> <span \
class="o">&&</span> <span class="n">resultTag</span><span \
class="p">.</span><span class="n">compare</span><span class="p">(</span><span \
class="n">tag</span><span class="p">,</span> <span class="n">Qt</span><span \
class="o">::</span><span class="n">CaseInsensitive</span><span class="p">))</span> \
<span class="p">{</span></pre></td> </tr>
</tbody>
</table>
<div style="margin-left: 2em;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">QString::compare returns 0 on match or < 0 and > 0 depending on which \
term is larger. I don't quite understand what is going on over here.</p></pre> \
</div> </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="https://git.reviewboard.kde.org/r/128664/diff/1/?file=474469#file474469line396" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/kioslaves/tags/kio_tags.cpp</a> <span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">384</font></th> <td bgcolor="#ffffff" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="n">TagsProtocol</span><span class="o">::</span><span \
class="n">ParseResult</span> <span class="n">TagsProtocol</span><span \
class="o">::</span><span class="n">parseUrl</span><span class="p">(</span><span \
class="k">const</span> <span class="n">QUrl</span><span class="o">&</span> <span \
class="n">url</span><span class="p">,</span> <span class="n">QString</span><span \
class="o">&</span> <span class="n">tag</span><span class="p">,</span> <span \
class="n">QString</span><span class="o">&</span> <span \
class="n">fileUrl</span><span class="p">,</span> <span class="kt">bool</span><span \
class="p">)</span></pre></td> <th bgcolor="#f0f0f0" style="border-left: 1px solid \
#C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font \
size="2">395</font></th> <td bgcolor="#ffffff" width="50%"><pre style="font-size: \
8pt; line-height: 140%; margin: 0; "><span class="n">TagsProtocol</span><span \
class="o">::</span><span class="n">ParseResult</span> <span \
class="n">TagsProtocol</span><span class="o">::</span><span \
class="n">parseUrl</span><span class="p">(</span><span class="k">const</span> <span \
class="n">QUrl</span><span class="o">&</span> <span class="n">url</span><span \
class="p">,</span> <span class="n">QString</span><span class="o">&</span> <span \
class="n">tag</span><span class="p">,</span> <span class="n">QString</span><span \
class="o">&</span> <span class="n">fileUrl</span><span class="p">,</span> <span \
class="kt">bool</span><span class="p">)</span></pre></td> </tr>
</tbody>
</table>
<div style="margin-left: 2em;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This \
code is getting hard to follow. Do you think you could write a simple unit test for \
just this function?</p> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">That way it will be clear what inputs \
it can accept.</p> <p style="padding: 0;text-rendering: inherit;margin: \
0;line-height: inherit;white-space: inherit;">Also I think this function can be made \
<code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: \
normal;margin: 0;line-height: inherit;">const</code>.</p></pre> </div>
</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="https://git.reviewboard.kde.org/r/128664/diff/1/?file=474470#file474470line58" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/lib/searchstore.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; \
">PostingIterator* SearchStore::constructQuery(Transaction* tr, const Term& \
term)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">58</font></th> <td bgcolor="#ffffff" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">m_prefixes</span><span class="p">.</span><span class="n">insert</span><span \
class="p">(</span><span class="n">QByteArray</span><span class="p">(</span><span \
class="s">"tag"</span><span class="p">),</span> <span \
class="n">QByteArray</span><span class="p">(</span><span \
class="s">"TA"</span><span class="p">));</span></pre></td> <th \
bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">58</font></th> <td bgcolor="#ffffff" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">m_prefixes</span><span class="p">.</span><span class="n">insert</span><span \
class="p">(</span><span class="n">QByteArray</span><span class="p">(</span><span \
class="s">"tag"</span><span class="p">),</span> <span \
class="n">QByteArray</span><span class="p">(</span><span \
class="s">"TA"</span><span class="p">));</span></pre></td> </tr>
</tbody>
</table>
<div style="margin-left: 2em;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I \
think this line along with the next can now be removed.</p></pre> </div>
</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="https://git.reviewboard.kde.org/r/128664/diff/1/?file=474470#file474470line270" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/lib/searchstore.cpp</a> <span style="font-weight: normal;">
(Diff revision 1)
</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">270</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span \
class="p">(</span><span class="n">property</span> <span class="o">==</span> <span \
class="s">"tag"</span><span class="p">)</span> <span \
class="p">{</span></pre></td> </tr>
</tbody>
</table>
<div style="margin-left: 2em;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">Please check for both "tag" and "tags".</p></pre> </div>
</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="https://git.reviewboard.kde.org/r/128664/diff/1/?file=474470#file474470line276" \
style="color: black; font-weight: bold; text-decoration: \
underline;">src/lib/searchstore.cpp</a> <span style="font-weight: normal;">
(Diff revision 1)
</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">276</font></th> <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> \
<span class="n">q</span> <span class="o">=</span> <span \
class="n">EngineQuery</span><span class="p">(</span><span class="n">prefix</span> \
<span class="o">+</span> <span class="n">value</span><span class="p">.</span><span \
class="n">toString</span><span class="p">().</span><span class="n">toUtf8</span><span \
class="p">(),</span> <span class="n">EngineQuery</span><span class="o">::</span><span \
class="n">Phrase</span><span class="p">);</span></pre></td> </tr>
</tbody>
</table>
<div style="margin-left: 2em;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Could \
you please explain what's going on over here? I don't understand it.</p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">From a cursory glance it seems that this code will assert. <code \
style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: \
0;line-height: inherit;">q</code> is of type <code style="text-rendering: \
inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: \
inherit;">EngineQuery::Phrase</code> and is a leaf query so <code \
style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: \
0;line-height: inherit;">Transaction::PostingIterator</code> will assert it <code \
style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: \
0;line-height: inherit;">Q_ASSERT(0)</code></p></pre> </div>
</div>
<br />
<p>- Vishesh Handa</p>
<br />
<p>On August 18th, 2016, 11:56 p.m. UTC, James Smith wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;"> <tr>
<td>
<div>Review request for Baloo and Vishesh Handa.</div>
<div>By James Smith.</div>
<p style="color: grey;"><i>Updated Aug. 18, 2016, 11:56 p.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=334615">334615</a>
</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
baloo
</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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Index and query each tag as a single full term for \
generating recursed search results. Represent nested tags as recursed items in the \
Tags:// KIO Slave.</p></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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Compile, run</p></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>src/file/basicindexingjob.cpp <span style="color: \
grey">(88bb59a01e5592abb74b1ab345bfc6765d35db57)</span></li>
<li>src/kioslaves/tags/kio_tags.cpp <span style="color: \
grey">(de2e6d71945632e23a85f831878b4c431360731c)</span></li>
<li>src/lib/searchstore.cpp <span style="color: \
grey">(060a4fd795ab858eb84526f93f827d09ee85db7c)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/128664/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
--===============1713656492104611765==--
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic