rpms/system-config-printer/F-11 system-config-printer-fetchdevices.patch, NONE, 1.1 system-config-printer.spec, 1.285, 1.286

Tim Waugh twaugh at fedoraproject.org
Tue Sep 22 09:31:53 UTC 2009


Author: twaugh

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

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-2
- 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-04 18:12:11.000000000 +0100
+++ system-config-printer-1.1.13/system-config-printer.py	2009-09-22 10:16:16.060543855 +0100
@@ -3841,9 +3841,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"))
@@ -4634,16 +4632,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:
@@ -5035,6 +5035,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/F-11/system-config-printer.spec,v
retrieving revision 1.285
retrieving revision 1.286
diff -u -p -r1.285 -r1.286
--- system-config-printer.spec	14 Sep 2009 15:11:55 -0000	1.285
+++ system-config-printer.spec	22 Sep 2009 09:31:53 -0000	1.286
@@ -7,7 +7,7 @@
 Summary: A printer administration tool
 Name: system-config-printer
 Version: 1.1.13
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv2+
 URL: http://cyberelk.net/tim/software/system-config-printer/
 Group: System Environment/Base
@@ -15,6 +15,8 @@ Source0: http://cyberelk.net/tim/data/sy
 Source1: http://cyberelk.net/tim/data/pycups/pycups-%{pycups_version}.tar.bz2
 Source2: http://cyberelk.net/tim/data/pysmbc/pysmbc-%{pysmbc_version}.tar.bz2
 
+Patch1: system-config-printer-fetchdevices.patch
+
 BuildRequires: cups-devel >= 1.2
 BuildRequires: python-devel >= 2.4
 BuildRequires: libsmbclient-devel >= 3.2
@@ -62,6 +64,7 @@ the configuration tool.
 
 %prep
 %setup -q -a 1 -a 2
+%patch1 -p1 -b .fetchdevices
 
 %build
 %configure
@@ -163,6 +166,9 @@ rm -rf %buildroot
 exit 0
 
 %changelog
+* Tue Sep 22 2009 Tim Waugh <twaugh at redhat.com> 1.1.13-2
+- Fixed race when fetching device list (bug #521110).
+
 * Mon Sep 14 2009 Tim Waugh <twaugh at redhat.com> 1.1.13-1
 - 1.1.13:
   - Translation updates (bug #522451).




More information about the scm-commits mailing list