Web lists-archives.com

Re: Review Request 128183: Ignore malformed Queries which have a binary operator without first argument




This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/128183/

Fix it, then Ship it!

Looks good (at this point it's just nitpicking, feel free to push as is, or fix+push)


autotests/unit/lib/advancedqueryparsertest.cpp (Diff revision 2)
197
    Term term = parser.parse(QStringLiteral("=:2"));

You could actually use QTest::ignoreMessage() here, to silence the qDebug and ensure it worked (this would have detected the issue below :-)


src/lib/advancedqueryparser.cpp (Diff revision 2)
156
                qDebug() << "Binary operator without first argument encountered: " << text;

No need for a space after the ':', qDebug adds spaces between arguments.


- David Faure


On June 14th, 2016, 6:54 p.m. UTC, Pinak Ahuja wrote:

Review request for Baloo and David Faure.
By Pinak Ahuja.

Updated June 14, 2016, 6:54 p.m.

Repository: baloo

Description

Queries like =:2 make our QueryParser behave unexpectedly, now if we have a binary operator without a first arg we just return an empty term.

Diffs

  • autotests/unit/lib/advancedqueryparsertest.cpp (05696a2)
  • src/lib/advancedqueryparser.cpp (a42a3c6)

View Diff