mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix layout state being saved incorrectly if calibre is killed without a proper shutdown
This commit is contained in:
parent
fff1892577
commit
604bae8a45
@ -135,6 +135,7 @@ class GuiRunner(QObject):
|
|||||||
main = Main(self.opts, gui_debug=self.gui_debug)
|
main = Main(self.opts, gui_debug=self.gui_debug)
|
||||||
if self.splash_screen is not None:
|
if self.splash_screen is not None:
|
||||||
self.splash_screen.showMessage(_('Initializing user interface...'))
|
self.splash_screen.showMessage(_('Initializing user interface...'))
|
||||||
|
with gprefs: # Only write gui.json after initialization is complete
|
||||||
main.initialize(self.library_path, db, self.listener, self.actions)
|
main.initialize(self.library_path, db, self.listener, self.actions)
|
||||||
if self.splash_screen is not None:
|
if self.splash_screen is not None:
|
||||||
self.splash_screen.finish(main)
|
self.splash_screen.finish(main)
|
||||||
|
@ -367,6 +367,8 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
|||||||
self.keyboard.finalize()
|
self.keyboard.finalize()
|
||||||
self.auto_adder = AutoAdder(gprefs['auto_add_path'], self)
|
self.auto_adder = AutoAdder(gprefs['auto_add_path'], self)
|
||||||
|
|
||||||
|
self.save_layout_state()
|
||||||
|
|
||||||
# Collect cycles now
|
# Collect cycles now
|
||||||
gc.collect()
|
gc.collect()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user