IGN:Fix minor bug in advanced search dialog if only a none term is specified

This commit is contained in:
Kovid Goyal 2009-03-28 18:08:30 -07:00
parent d6903d4def
commit b1357eae0c

View File

@ -20,7 +20,8 @@ class SearchDialog(QDialog, Ui_Dialog):
return [t.strip() for t in phrases + raw.split()]
def search_string(self):
all, any, phrase, none = map(lambda x: unicode(x.text()), (self.all, self.any, self.phrase, self.none))
all, any, phrase, none = map(lambda x: unicode(x.text()),
(self.all, self.any, self.phrase, self.none))
all, any, none = map(self.tokens, (all, any, none))
phrase = phrase.strip()
all = ' and '.join(all)
@ -32,7 +33,7 @@ class SearchDialog(QDialog, Ui_Dialog):
if all:
ans += (' and ' if ans else '') + all
if none:
ans += (' and not ' if ans else '') + none
ans += (' and not ' if ans else 'not') + none
if any:
ans += (' or ' if ans else '') + any
return ans