- Make sure the printer we added still exists before selecting it (bug

#551436).
This commit is contained in:
Tim Waugh 2010-01-06 15:50:44 +00:00
parent 437a3ab1b8
commit a29d1fb03e
2 changed files with 28 additions and 0 deletions

View File

@ -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).

View File

@ -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 <twaugh@redhat.com> - 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).