telepathy-gabble: console UI: quit cleanly if connection has gone away

Simon McVittie smcv at kemper.freedesktop.org
Mon Oct 14 08:21:20 PDT 2013


Module: telepathy-gabble
Branch: master
Commit: c53a7c69b9b6615a73a392879458f6a4314ca1a8
URL:    http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=c53a7c69b9b6615a73a392879458f6a4314ca1a8

Author: Will Thompson <will.thompson at collabora.co.uk>
Date:   Mon Feb 13 12:13:24 2012 +0000

console UI: quit cleanly if connection has gone away

The console UI doesn't watch for NameOwnerChanged to notice the
connection going away from beneath it. No big deal, it's a tool for
nerds, but if you tried to quit it, it would not close cleanly: the call
to self.snoopy.teardown() (which tries to turn off the connection
dumping all stanzas over D-Bus) throws an exception, and so
Gtk.main_quit() never got called.

---

 plugins/telepathy-gabble-xmpp-console |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/plugins/telepathy-gabble-xmpp-console b/plugins/telepathy-gabble-xmpp-console
index 8b96469..731929b 100755
--- a/plugins/telepathy-gabble-xmpp-console
+++ b/plugins/telepathy-gabble-xmpp-console
@@ -347,7 +347,11 @@ plugin installed.""" % locals()
         self.connect('destroy', Window.__destroy_cb)
 
     def __destroy_cb(self):
-        self.snoopy.teardown()
+        try:
+            self.snoopy.teardown()
+        except GLib.GError, e:
+            print "Couldn't turn off the monitor (maybe the connection went away?)"
+            print e
         Gtk.main_quit()
 
 GABBLE_PREFIX = 'org.freedesktop.Telepathy.Connection.gabble.jabber.'



More information about the telepathy-commits mailing list