hplip/hplip-systray-dbus-exception.patch
Tim Waugh a5d4dfe5d4 Fixed typo in systemtray.py (bug #991638).
Resolves: rhbz#991638
2013-08-14 14:08:02 +01:00

28 lines
1.2 KiB
Diff

diff -up hplip-3.13.7/ui4/systemtray.py.systray-dbus-exception hplip-3.13.7/ui4/systemtray.py
--- hplip-3.13.7/ui4/systemtray.py.systray-dbus-exception 2013-07-23 06:13:40.000000000 +0100
+++ hplip-3.13.7/ui4/systemtray.py 2013-08-05 15:52:44.904186798 +0100
@@ -466,7 +466,7 @@ class SystemTrayApp(QApplication):
try:
self.service = self.session_bus.get_object('com.hplip.StatusService',
"/com/hplip/StatusService")
- except DBusException:
+ except dbus.DBusException:
log.warn("Unable to connect to StatusService. Retrying...")
t += 1
@@ -820,7 +820,13 @@ def run(read_pipe):
log.set_module("hp-systray(qt4)")
log.debug("PID=%d" % os.getpid())
- app = SystemTrayApp(sys.argv, read_pipe)
+ try:
+ app = SystemTrayApp(sys.argv, read_pipe)
+ except dbus.DBusException, e:
+ # No session bus
+ log.debug("Caught exception: %s" % e)
+ sys.exit(1)
+
app.setQuitOnLastWindowClosed(False) # If not set, settings dlg closes app
i = 0