Merge remote-tracking branch 'origin/pr/3367'

This commit is contained in:
Florian Bruhin 2017-12-06 06:57:59 +01:00
commit 0df1d07558
2 changed files with 5 additions and 1 deletions

View File

@ -47,7 +47,7 @@ class HistoryCategory(QSqlQueryModel):
"FROM CompletionHistory", "FROM CompletionHistory",
# the incoming pattern will have literal % and _ escaped with '\' # the incoming pattern will have literal % and _ escaped with '\'
# we need to tell sql to treat '\' as an escape character # we need to tell sql to treat '\' as an escape character
"WHERE (url LIKE :pat escape '\\' or title LIKE :pat escape '\\')", "WHERE ((url || title) LIKE :pat escape '\\')",
self._atime_expr(), self._atime_expr(),
"ORDER BY last_atime DESC", "ORDER BY last_atime DESC",
]), forward_only=False) ]), forward_only=False)

View File

@ -78,6 +78,10 @@ def hist(init_sql, config_stub):
("can't", ("can't",
[("can't touch this", ''), ('a', '')], [("can't touch this", ''), ('a', '')],
[("can't touch this", '')]), [("can't touch this", '')]),
("ample itle",
[('example.com', 'title'), ('example.com', 'nope')],
[('example.com', 'title')]),
]) ])
def test_set_pattern(pattern, before, after, model_validator, hist): def test_set_pattern(pattern, before, after, model_validator, hist):
"""Validate the filtering and sorting results of set_pattern.""" """Validate the filtering and sorting results of set_pattern."""