From cf248903eb889ad87e3c2e409664864ffa2b9804 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Wed, 5 Jan 2011 12:39:01 +0100 Subject: [PATCH] Catch GError exception when notification showing failed (bug #665577). --- hplip-notification-exception.patch | 23 +++++++++++++++++++++++ hplip.spec | 9 ++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 hplip-notification-exception.patch diff --git a/hplip-notification-exception.patch b/hplip-notification-exception.patch new file mode 100644 index 0000000..f0a7fb8 --- /dev/null +++ b/hplip-notification-exception.patch @@ -0,0 +1,23 @@ +diff -up hplip-3.10.9/ui4/systemtray.py.notification-exception hplip-3.10.9/ui4/systemtray.py +--- hplip-3.10.9/ui4/systemtray.py.notification-exception 2011-01-05 10:45:57.000000000 +0100 ++++ hplip-3.10.9/ui4/systemtray.py 2011-01-05 12:34:18.000000000 +0100 +@@ -27,6 +27,7 @@ import os + import signal + import os.path + import time ++import gobject + + + # Local +@@ -662,7 +663,10 @@ class SystemTrayApp(QApplication): + else: + n.set_timeout(TRAY_MESSAGE_DELAY) + +- n.show() ++ try: ++ n.show() ++ except gobject.GError: ++ log.error("Failed to show notification!") + + else: # Use "standard" message bubbles + icon = ERROR_STATE_TO_ICON.get(error_state, QSystemTrayIcon.Information) diff --git a/hplip.spec b/hplip.spec index 001c70c..fe02131 100644 --- a/hplip.spec +++ b/hplip.spec @@ -1,7 +1,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.10.9 -Release: 9%{?dist} +Release: 10%{?dist} License: GPLv2+ and MIT Group: System Environment/Daemons Conflicts: system-config-printer < 0.6.132 @@ -47,6 +47,7 @@ Patch30: hplip-dbus-exception.patch Patch31: hplip-hpaio-segfault.patch Patch32: hplip-newline.patch Patch33: hplip-dbus-threads.patch +Patch34: hplip-notification-exception.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -289,6 +290,9 @@ done # Enable D-Bus threading (and require pygobject2) (bug #600932). %patch33 -p1 -b .dbus-threads +# Catch GError exception when notification showing failed (bug #665577). +%patch34 -p1 -b .notification-exception + sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -515,6 +519,9 @@ fi %postun libs -p /sbin/ldconfig %changelog +* Wed Jan 05 2011 Jiri Popelka 3.10.9-10 +- Catch GError exception when notification showing failed (bug #665577). + * Wed Dec 15 2010 Tim Waugh - 3.10.9-9 - Enable D-Bus threading (and require pygobject2) (bug #600932). - Fixed incorrect signal name in setup dialog (bug #653626).