mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-02-05 20:25:17 +01:00
ToC Editor: Fix save/load of settings int he XPath wizard not working across restarts
This commit is contained in:
parent
9daaa81437
commit
9bf8dcf4ca
1 changed files with 3 additions and 2 deletions
|
|
@ -75,7 +75,8 @@ def save_settings(self):
|
|||
name = unicode(name).strip()
|
||||
if name:
|
||||
saved = self.prefs.get('xpath_toc_settings', {})
|
||||
saved[name] = {i:x for i, x in enumerate(xpaths)}
|
||||
# in JSON all keys have to be strings
|
||||
saved[name] = {str(i):x for i, x in enumerate(xpaths)}
|
||||
self.prefs.set('xpath_toc_settings', saved)
|
||||
self.setup_load_button()
|
||||
|
||||
|
|
@ -98,7 +99,7 @@ def clear_settings(self):
|
|||
def load_settings(self, name):
|
||||
saved = self.prefs.get('xpath_toc_settings', {}).get(name, {})
|
||||
for i, w in enumerate(self.widgets):
|
||||
txt = saved.get(i, '')
|
||||
txt = saved.get(str(i), '')
|
||||
w.edit.setText(txt)
|
||||
|
||||
def check(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue