From dc55185da7c1f3e9abc21a5652129563471da932 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sat, 11 Mar 2017 18:38:06 +0100 Subject: [PATCH 1/2] Fix the formatter functions not being reloaded after a check library --- src/calibre/gui2/actions/choose_library.py | 6 +++--- src/calibre/gui2/dialogs/check_library.py | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/actions/choose_library.py b/src/calibre/gui2/actions/choose_library.py index 3937975e76..19b343599c 100644 --- a/src/calibre/gui2/actions/choose_library.py +++ b/src/calibre/gui2/actions/choose_library.py @@ -493,16 +493,16 @@ class ChooseLibraryAction(InterfaceAction): m.stop_metadata_backup() db = m.db db.prefs.disable_setting = True + library_path = db.library_path d = DBCheck(self.gui, db) d.start() try: - d.conn.close() + m.close() except: pass d.break_cycles() - self.gui.library_moved(db.library_path, call_close=not - d.closed_orig_conn) + self.gui.library_moved(library_path, call_close=False) if d.rejected: return if d.error is None: diff --git a/src/calibre/gui2/dialogs/check_library.py b/src/calibre/gui2/dialogs/check_library.py index 5e6c4999ba..5fb5bdc9b4 100644 --- a/src/calibre/gui2/dialogs/check_library.py +++ b/src/calibre/gui2/dialogs/check_library.py @@ -37,7 +37,6 @@ class DBCheck(QDialog): # {{{ self.resize(self.sizeHint() + QSize(100, 50)) self.error = None self.db = db.new_api - self.closed_orig_conn = False self.rejected = False def start(self): From b9b688efc5beec0c98d7719e74096361363aec9f Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sat, 11 Mar 2017 18:38:56 +0100 Subject: [PATCH 2/2] During shutdown, the gui attempts to update itself if a library closed plugin updates columns. This happens because the gui thinks the database is still open when the windows are being hidden. --- src/calibre/gui2/ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index 06dea6bbb8..f3d4d03d87 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -956,7 +956,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{ mb.stop() if db is not None: - db.close() + self.library_view.model().close() try: try: