rpms/system-config-printer/devel system-config-printer-fetchdevices.patch, NONE, 1.1 system-config-printer.spec, 1.297, 1.298

Tim Waugh twaugh at fedoraproject.org
Tue Sep 22 09:30:05 UTC 2009


Author: twaugh

Update of /cvs/pkgs/rpms/system-config-printer/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv11311

Modified Files:
	system-config-printer.spec 
Added Files:
	system-config-printer-fetchdevices.patch 
Log Message:
* Tue Sep 22 2009 Tim Waugh <twaugh at redhat.com> 1.1.13-3
- Fixed race when fetching device list (bug #521110).


system-config-printer-fetchdevices.patch:
 system-config-printer.py |   24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

--- NEW FILE system-config-printer-fetchdevices.patch ---
diff -up system-config-printer-1.1.13/system-config-printer.py.fetchdevices system-config-printer-1.1.13/system-config-printer.py
--- system-config-printer-1.1.13/system-config-printer.py.fetchdevices	2009-09-22 10:08:54.062669053 +0100
+++ system-config-printer-1.1.13/system-config-printer.py	2009-09-22 10:10:12.138669093 +0100
@@ -3855,9 +3855,7 @@ class NewPrinterGUI(GtkGUI):
             self.fillDeviceTab()
             self.rbtnNPFoomatic.set_active (True)
             self.on_rbtnNPFoomatic_toggled(self.rbtnNPFoomatic)
-            # Start fetching information from CUPS in the background
             self.new_printer_PPDs_loaded = False
-            self.queryPPDs ()
 
         elif self.dialog_mode == "class":
             self.NewPrinterWindow.set_title(_("New Class"))
@@ -4648,16 +4646,18 @@ class NewPrinterGUI(GtkGUI):
         debugprint ("fetchDevices")
 
         have_polkit_1 = self.mainapp.cups._use_pk and config.WITH_POLKIT_1
-        if not have_polkit_1:
-            if network:
-                return {}
-
-            network = True
-
         network_schemes = ["dnssd", "snmp"]
         try:
-            c = authconn.Connection (host=self.mainapp.connect_server,
-                                     parent=parent, lock=True)
+            try:
+                c = self.fetchDevices_conn
+            except AttributeError:
+                c = authconn.Connection (host=self.mainapp.connect_server,
+                                         parent=parent, lock=True)
+                if not have_polkit_1:
+                    # Use this connection for future calls so that the
+                    # username/password is cached.
+                    self.fetchDevices_conn = c
+
             debugprint ("in get_devices: connected")
             c._begin_operation (_("fetching device list"))
             try:
@@ -5049,6 +5049,10 @@ class NewPrinterGUI(GtkGUI):
                                                    kwargs={"network": True},
                                                    callback=self.got_devices,
                                                    context=context)
+        else:
+            # Now we've fetched both local and network devices, start
+            # querying the available PPDs.
+            gobject.timeout_add (1, self.queryPPDs)
 
         devices = result
         if current_uri:


Index: system-config-printer.spec
===================================================================
RCS file: /cvs/pkgs/rpms/system-config-printer/devel/system-config-printer.spec,v
retrieving revision 1.297
retrieving revision 1.298
diff -u -p -r1.297 -r1.298
--- system-config-printer.spec	18 Sep 2009 13:01:39 -0000	1.297
+++ system-config-printer.spec	22 Sep 2009 09:30:05 -0000	1.298
@@ -7,7 +7,7 @@
 Summary: A printer administration tool
 Name: system-config-printer
 Version: 1.1.13
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: GPLv2+
 URL: http://cyberelk.net/tim/software/system-config-printer/
 Group: System Environment/Base
@@ -19,6 +19,7 @@ Patch1: system-config-printer-data-butto
 Patch2: system-config-printer-cancel-traceback.patch
 Patch3: system-config-printer-publish-printers.patch
 Patch4: system-config-printer-iconify.patch
+Patch5: system-config-printer-fetchdevices.patch
 
 BuildRequires: cups-devel >= 1.2
 BuildRequires: python-devel >= 2.4
@@ -83,6 +84,7 @@ printers.
 %patch2 -p1 -b .cancel-traceback
 %patch3 -p1 -b .publish-printers
 %patch4 -p1 -b .iconify
+%patch5 -p1 -b .fetchdevices
 
 %build
 %configure --with-udev-rules --with-polkit-1
@@ -194,6 +196,9 @@ rm -rf %buildroot
 exit 0
 
 %changelog
+* Tue Sep 22 2009 Tim Waugh <twaugh at redhat.com> 1.1.13-3
+- Fixed race when fetching device list (bug #521110).
+
 * Fri Sep 18 2009 Tim Waugh <twaugh at redhat.com> 1.1.13-2
 - Iconify jobs window into status icon.
 - Avoid showing the publish-printers dialog when not necessary.




More information about the fedora-extras-commits mailing list