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):
|
||||
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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user