Dont store very short strings in the history

This commit is contained in:
Kovid Goyal 2013-06-13 15:41:18 +05:30
parent b4f35dcaeb
commit d005aa5906

View File

@ -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)