Diffusion Baloo c91c43393c33

Fix merging of terms in the AdvancedQueryParser

Authored by bruns on Apr 7 2018, 12:44 AM.

Description

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

Details

Committed
brunsApr 13 2018, 11:29 PM
Reviewer
Baloo
Differential Revision
D12005: Fix merging of terms in the AdvancedQueryParser
Parents
R293:0491ba6e8e96: Use QStorageInfo instead of a homegrown implementation
Branches
Unknown
Tags
Unknown