mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 19:33:41 +02:00
DRYer
This commit is contained in:
parent
8c454346a2
commit
ebbefb5de3
1 changed files with 4 additions and 1 deletions
|
|
@ -36,7 +36,7 @@ def store_name(self):
|
|||
|
||||
def initialize(self, name):
|
||||
self._name = name
|
||||
self.history = history.get(self.store_name, [])
|
||||
self.history = self.load_history()
|
||||
self.set_separator(None)
|
||||
self.update_items_cache(self.history)
|
||||
self.setText('')
|
||||
|
|
@ -45,6 +45,9 @@ def initialize(self, name):
|
|||
except AttributeError:
|
||||
self.lineEdit().editingFinished.connect(self.save_history)
|
||||
|
||||
def load_history(self):
|
||||
return history.get(self.store_name, [])
|
||||
|
||||
def save_history(self):
|
||||
ct = unicode_type(self.text())
|
||||
if len(ct) >= self.min_history_entry_length:
|
||||
|
|
|
|||
Loading…
Reference in a new issue