Add missing paranthesis

Not sure how these slipped through.
This commit is contained in:
Albert S. 2021-06-12 22:50:27 +02:00
parent 248bfb96fe
commit 01872e37d5
2 changed files with 3 additions and 3 deletions

View File

@ -277,7 +277,7 @@ LooqsQuery LooqsQuery::build(QString expression)
throw LooqsGeneralException("Two sort statements are illegal");
}
// TODO: hack, since we are not a "filter", we must remove a preceeding (implicit) boolean
if(result.tokens.last().type & BOOL == BOOL)
if((result.tokens.last().type & BOOL) == BOOL)
{
result.tokens.pop_back();
}
@ -292,7 +292,7 @@ LooqsQuery LooqsQuery::build(QString expression)
}
}
bool contentsearch = result.getTokensMask() & FILTER_CONTENT == FILTER_CONTENT;
bool contentsearch = (result.getTokensMask() & FILTER_CONTENT) == FILTER_CONTENT;
bool sortsForContent = std::any_of(result.sortConditions.begin(), result.sortConditions.end(),
[](SortCondition c) { return c.field == CONTENT_TEXT; });

View File

@ -127,7 +127,7 @@ QSqlQuery SqliteSearch::makeSqlQuery(const LooqsQuery &query)
QString whereSql;
QString joinSql;
QVector<QString> bindValues;
bool isContentSearch = query.getTokensMask() & FILTER_CONTENT == FILTER_CONTENT;
bool isContentSearch = (query.getTokensMask() & FILTER_CONTENT) == FILTER_CONTENT;
if(query.getTokens().isEmpty())
{
throw LooqsGeneralException("Nothing to search for supplied");