Fix merging of terms in the AdvancedQueryParser
Summary:
The code merged compatible terms only if the left hand side was a list of
subterms (i.e. it worked for "a AND b AND (c AND d)", but not
"b AND (c AND d)"). Instead of duplicating code, just use the
Term(Term, Operation, Term) constructor, which handles merging.
Test Plan:
ctest -V -R advancedqueryparser
38: QDEBUG : AdvancedQueryParserTest::testNestedParentheses((a AND (b AND (c AND d)))) result term ( AND ( : a (QString)) ( : b (QString)) ( : c (QString)) ( : d (QString)) ) 38: QDEBUG : AdvancedQueryParserTest::testNestedParentheses((a AND (b AND (c AND d)))) expected term ( AND ( : a (QString)) ( : b (QString)) ( : c (QString)) ( : d (QString)) ) 38: PASS : AdvancedQueryParserTest::testNestedParentheses((a AND (b AND (c AND d))))
Reviewers: Baloo, michaelh
Reviewed By: Baloo, michaelh
Subscribers: Frameworks
Tags: Frameworks, Baloo
Differential Revision: https://phabricator.kde.org/D12005