From d005aa59064d9e12772122e0689797a133943198 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 13 Jun 2013 15:41:18 +0530 Subject: [PATCH] Dont store very short strings in the history --- src/calibre/gui2/widgets2.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/calibre/gui2/widgets2.py b/src/calibre/gui2/widgets2.py index c6b0bdaf0c..c53ae2e93f 100644 --- a/src/calibre/gui2/widgets2.py +++ b/src/calibre/gui2/widgets2.py @@ -25,10 +25,12 @@ class HistoryLineEdit2(LineEdit): def save_history(self): ct = unicode(self.text()) - try: - self.history.remove(ct) - except ValueError: - pass - self.history.insert(0, ct) - history.set(self.store_name, self.history) + if len(ct) > 2: + try: + self.history.remove(ct) + except ValueError: + pass + self.history.insert(0, ct) + history.set(self.store_name, self.history) + self.update_items_cache(self.history)