From 43a662a250f29e8e229c8ab655df08c9223e54fc Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 12 Apr 2017 18:40:37 +1000 Subject: [PATCH] hack around the browser not closing on sync saveNow() must run asynchronously, but unloadCollection() was not designed to. fix the issue by skipping the save, as it's unlikely the user can move the cursor from the editor to the main window and start a sync before the timer has automatically saved the contents. --- aqt/browser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aqt/browser.py b/aqt/browser.py index 5d3a52f9e..98a09ff52 100644 --- a/aqt/browser.py +++ b/aqt/browser.py @@ -354,6 +354,7 @@ class Browser(QMainWindow): applyStyles(self) self.mw = mw self.col = self.mw.col + self.forceClose = False self.lastFilter = "" self._previewWindow = None self._closeEventHasCleanedUp = False @@ -460,7 +461,7 @@ class Browser(QMainWindow): def closeEvent(self, evt): if not self._closeEventHasCleanedUp: - if self.editor.note: + if self.editor.note and not self.forceClose: # ignore event for now to allow us to save self.editor.saveNow(self._closeEventAfterSave) evt.ignore()