mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Dont store very short strings in the history
This commit is contained in:
parent
b4f35dcaeb
commit
d005aa5906
@ -25,10 +25,12 @@ class HistoryLineEdit2(LineEdit):
|
|||||||
|
|
||||||
def save_history(self):
|
def save_history(self):
|
||||||
ct = unicode(self.text())
|
ct = unicode(self.text())
|
||||||
|
if len(ct) > 2:
|
||||||
try:
|
try:
|
||||||
self.history.remove(ct)
|
self.history.remove(ct)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
self.history.insert(0, ct)
|
self.history.insert(0, ct)
|
||||||
history.set(self.store_name, self.history)
|
history.set(self.store_name, self.history)
|
||||||
|
self.update_items_cache(self.history)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user