<table><tr><td style="">bruns added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D11907">View Revision</a></tr></table><br /><div><div><p>Although this is probably a useful addition (haven't checked which cases the existing unit test already cover), it does not cover the changes in <a href="https://phabricator.kde.org/D11826" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">D11826</a>.</p>
<p>The code in <a href="https://cgit.kde.org/baloo.git/tree/src/lib/advancedqueryparser.cpp#n100" class="remarkup-link" target="_blank" rel="noreferrer">https://cgit.kde.org/baloo.git/tree/src/lib/advancedqueryparser.cpp#n100</a> replicates the new logic in the <tt style="background: #ebebeb; font-size: 13px;">Term::Term(Term&, Operation&, Term&)</tt> constructor (merging of compatible terms), and, after the changes in <a href="https://phabricator.kde.org/D11826" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;">D11826</a>, could be replaced with just</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">static void addTermToStack(QStack<Term>& stack, const Term& termInConstruction, Term::Operation op)
{
auto top = stack.pop();
stack.push(Term(top, op, termInConstruction));
}</pre></div>
<p><tt style="background: #ebebeb; font-size: 13px;">operator&&</tt> is e.g. used in<br />
<a href="https://cgit.kde.org/baloo.git/tree/src/lib/query.cpp#n189" class="remarkup-link" target="_blank" rel="noreferrer">https://cgit.kde.org/baloo.git/tree/src/lib/query.cpp#n189</a></p>
<p>To test operator&&, the following should be true:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">Term{Term:And, {Term{"", "a"}, Term{"", "b"}, Term{"", "c"}, Term{"", "d"} }
==
Term{"", "a"} && Term{"", "b"} && Term{"", "c"} && Term{"", "d"}</pre></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R293 Baloo</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D11907">https://phabricator.kde.org/D11907</a></div></div><br /><div><strong>To: </strong>michaelh, Baloo, bruns<br /><strong>Cc: </strong>Frameworks, ashaposhnikov, michaelh, astippich, spoorun, ngraham, alexeymin<br /></div>