From a29d1fb03efcbda90993d6d42564c50d74864571 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Wed, 6 Jan 2010 15:50:44 +0000 Subject: [PATCH] - Make sure the printer we added still exists before selecting it (bug #551436). --- ...g-printer-select-nonexistent-printer.patch | 24 +++++++++++++++++++ system-config-printer.spec | 4 ++++ 2 files changed, 28 insertions(+) create mode 100644 system-config-printer-select-nonexistent-printer.patch diff --git a/system-config-printer-select-nonexistent-printer.patch b/system-config-printer-select-nonexistent-printer.patch new file mode 100644 index 0000000..56188cc --- /dev/null +++ b/system-config-printer-select-nonexistent-printer.patch @@ -0,0 +1,24 @@ +diff -up system-config-printer-1.1.16/system-config-printer.py.select-nonexistent-printer system-config-printer-1.1.16/system-config-printer.py +--- system-config-printer-1.1.16/system-config-printer.py.select-nonexistent-printer 2010-01-06 15:46:02.056410131 +0000 ++++ system-config-printer-1.1.16/system-config-printer.py 2010-01-06 15:46:54.226408979 +0000 +@@ -6896,6 +6896,8 @@ class NewPrinterGUI(GtkGUI): + self.mainapp.cups.addPrinter(name, ppd=ppd) + except cups.IPPError, (e, msg): + self.show_IPP_Error(e, msg) ++ self.mainapp.cups._end_operation () ++ return + + self.mainapp.cups._end_operation () + +@@ -6923,6 +6925,11 @@ class NewPrinterGUI(GtkGUI): + + iter = model.iter_next (iter) + ++ if not self.printers.has_key (name): ++ # At this stage the printer has disappeared even though we ++ # only added it moments ago. ++ return ++ + # Load information about the printer, + # e.g. self.mainapp.server_side_options and self.mainapp.ppd + # (both used below). diff --git a/system-config-printer.spec b/system-config-printer.spec index dc47642..3a1c045 100644 --- a/system-config-printer.spec +++ b/system-config-printer.spec @@ -22,6 +22,7 @@ Patch4: system-config-printer-foomatic-recommended.patch Patch5: system-config-printer-jobviewer-exit.patch Patch6: system-config-printer-npinit-traceback.patch Patch7: system-config-printer-notification-timeouts.patch +Patch8: system-config-printer-select-nonexistent-printer.patch BuildRequires: cups-devel >= 1.2 BuildRequires: python-devel >= 2.4 @@ -88,6 +89,7 @@ printers. %patch5 -p1 -b .jobviewer-exit %patch6 -p1 -b .npinit-traceback %patch7 -p1 -b .notification-timeouts +%patch8 -p1 -b .select-nonexistent-printer %build %configure --with-udev-rules --with-polkit-1 @@ -205,6 +207,8 @@ exit 0 %changelog * Wed Jan 6 2010 Tim Waugh - 1.1.16-3 +- Make sure the printer we added still exists before selecting it + (bug #551436). - Set notification timeouts appropriately (bug #550829). - Avoid traceback in NewPrinterGUI.init (bug #550442). - Avoid traceback in on_jobviewer_exit (bug #550437).