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.
This commit is contained in:
Damien Elmes 2017-04-12 18:40:37 +10:00
parent aa89d06304
commit 43a662a250

View File

@ -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()