From 6574a08d3ca32583d63c10c6dbf69d58249727a5 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Mon, 25 Jan 2010 16:28:00 +0000 Subject: [PATCH] - Only add current device to list when all devices found (bug #558524). --- clog1 | 4 +-- system-config-printer-duplicate-current.patch | 33 +++++++++++++++++++ system-config-printer.spec | 3 ++ 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 system-config-printer-duplicate-current.patch diff --git a/clog1 b/clog1 index 66c55ca..86aeabe 100644 --- a/clog1 +++ b/clog1 @@ -1,2 +1,2 @@ -* Thu Jan 21 2010 Tim Waugh - 1.1.90-2 -- Added GtkAdjustments for all XML-declared SpinButtons. +* Mon Jan 25 2010 Tim Waugh - 1.1.90-3 +- Only add current device to list when all devices found (bug #558524). diff --git a/system-config-printer-duplicate-current.patch b/system-config-printer-duplicate-current.patch new file mode 100644 index 0000000..de27624 --- /dev/null +++ b/system-config-printer-duplicate-current.patch @@ -0,0 +1,33 @@ +diff -up system-config-printer-1.1.90/system-config-printer.py.duplicate-current system-config-printer-1.1.90/system-config-printer.py +--- system-config-printer-1.1.90/system-config-printer.py.duplicate-current 2010-01-25 16:22:42.885084708 +0000 ++++ system-config-printer-1.1.90/system-config-printer.py 2010-01-25 16:22:56.142210328 +0000 +@@ -4757,7 +4757,7 @@ class NewPrinterGUI(GtkGUI): + self.fetchDevices_conn = None + + # Add the network devices to the list. +- self.add_devices (result, current_uri) ++ self.add_devices (result, current_uri, no_more=True) + + def get_hpfax_device_id(self, faxuri): + os.environ["URI"] = faxuri +@@ -4910,16 +4910,18 @@ class NewPrinterGUI(GtkGUI): + self.fetchDevices_conn._begin_operation (_("fetching device list")) + self.fetchDevices (network=False, current_uri=current_uri) + +- def add_devices (self, devices, current_uri): ++ def add_devices (self, devices, current_uri, no_more=False): + if current_uri: + if devices.has_key (current_uri): + current = devices.pop(current_uri) + elif devices.has_key (current_uri.replace (":9100", "")): + current_uri = current_uri.replace (":9100", "") + current = devices.pop(current_uri) +- else: ++ elif no_more: + current = cupshelpers.Device (current_uri) + current.info = "Current device" ++ else: ++ current_uri = None + + devices = devices.values() + diff --git a/system-config-printer.spec b/system-config-printer.spec index 56f1e91..5b3856d 100644 --- a/system-config-printer.spec +++ b/system-config-printer.spec @@ -20,6 +20,7 @@ Patch2: system-config-printer-copy-printer.patch Patch3: system-config-printer-spinbuttons.patch Patch4: system-config-printer-raw-statereason.patch Patch5: system-config-printer-async-fallback-2.patch +Patch6: system-config-printer-duplicate-current.patch BuildRequires: cups-devel >= 1.2 BuildRequires: python-devel >= 2.4 @@ -84,6 +85,7 @@ printers. %patch3 -p1 -b .spinbuttons %patch4 -p1 -b .raw-statereason %patch5 -p1 -b .async-fallback-2 +%patch6 -p1 -b .duplicate-current %build %configure --with-udev-rules --with-polkit-1 @@ -200,6 +202,7 @@ exit 0 %changelog * Mon Jan 25 2010 Tim Waugh - 1.1.90-3 +- Only add current device to list when all devices found (bug #558524). - Fixed statereason localization for raw queues (bug #558156). - Fixed async fallback again (bug #557854).