mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
More viewer settings migrations fixes
This commit is contained in:
parent
162d836d90
commit
234b25da4d
@ -51,7 +51,7 @@ def migrate_previous_viewer_prefs():
|
|||||||
|
|
||||||
for k in ('top', 'bottom'):
|
for k in ('top', 'bottom'):
|
||||||
v = old_prefs.get(k + '_margin')
|
v = old_prefs.get(k + '_margin')
|
||||||
if v != 20:
|
if v != 20 and v is not None:
|
||||||
sd['margin_' + k] = v
|
sd['margin_' + k] = v
|
||||||
v = old_prefs.get('side_margin')
|
v = old_prefs.get('side_margin')
|
||||||
if v is not None and v != 40:
|
if v is not None and v != 40:
|
||||||
@ -62,10 +62,10 @@ def migrate_previous_viewer_prefs():
|
|||||||
|
|
||||||
cps = {'portrait': 0, 'landscape': 0}
|
cps = {'portrait': 0, 'landscape': 0}
|
||||||
cp = old_prefs.get('cols_per_screen_portrait')
|
cp = old_prefs.get('cols_per_screen_portrait')
|
||||||
if cp > 1:
|
if cp and cp > 1:
|
||||||
cps['portrait'] = cp
|
cps['portrait'] = cp
|
||||||
cl = old_prefs.get('cols_per_screen_landscape')
|
cl = old_prefs.get('cols_per_screen_landscape')
|
||||||
if cl > 1:
|
if cl and cl > 1:
|
||||||
cps['landscape'] = cp
|
cps['landscape'] = cp
|
||||||
if cps['portrait'] or cps['landscape']:
|
if cps['portrait'] or cps['landscape']:
|
||||||
sd['columns_per_screen'] = cps
|
sd['columns_per_screen'] = cps
|
||||||
|
Loading…
x
Reference in New Issue
Block a user