From 054960ebb021bca71a4c10842b0b33d54eaaaf9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Fri, 21 Jul 2017 12:34:38 +0200 Subject: [PATCH] Commit to DB at the last moment on shutdown It seems some events fire after prepare_quit(), notably set_room_last_message_time() --- gajim/gajim.py | 4 ++++ gajim/roster_window.py | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gajim/gajim.py b/gajim/gajim.py index 1e85ad1ba..fb6916c99 100644 --- a/gajim/gajim.py +++ b/gajim/gajim.py @@ -259,6 +259,10 @@ class GajimApplication(Gtk.Application): if hasattr(self.interface, 'roster') and self.interface.roster: self.interface.roster.prepare_quit() + # Commit any outstanding SQL transactions + from common import gajim + gajim.logger.commit() + def do_handle_local_options(self, options: GLib.VariantDict) -> int: logging_helpers.init() diff --git a/gajim/roster_window.py b/gajim/roster_window.py index 422b65378..d23491259 100644 --- a/gajim/roster_window.py +++ b/gajim/roster_window.py @@ -2468,9 +2468,6 @@ class RosterWindow: gajim.interface.hide_systray() self.save_done = True - # Commit any outstanding SQL transactions - gajim.logger.commit() - def quit_gtkgui_interface(self): """ When we quit the gtk interface - exit gtk