From bf64759aff82b9756787a67c23ebafc33ffaa6d5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 20 May 2017 20:01:24 +0530 Subject: [PATCH] Advanced search dialog: Fix combining of "One or more words" searches with other search types incorrect. Fixes #1691008 [Advanced Search grouping failure](https://bugs.launchpad.net/calibre/+bug/1691008) --- src/calibre/gui2/dialogs/search.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/dialogs/search.py b/src/calibre/gui2/dialogs/search.py index 5b010ee046..5292233dc9 100644 --- a/src/calibre/gui2/dialogs/search.py +++ b/src/calibre/gui2/dialogs/search.py @@ -176,7 +176,10 @@ class SearchDialog(QDialog, Ui_Dialog): if none: ans += (' and not ' if ans else 'not ') + none if any: - ans += (' or ' if ans else '') + any + if ans: + ans += ' and (' + any + ')' + else: + ans = any return ans def token(self):