From 1f72116762d7547f35959189dae3145c1cc74cc1 Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Fri, 2 Sep 2005 21:43:38 +0000 Subject: - Make building of main window of printerdrake much faster. --- perl-install/printer/cups.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'perl-install/printer') diff --git a/perl-install/printer/cups.pm b/perl-install/printer/cups.pm index 0ddff19f0..eb443482e 100644 --- a/perl-install/printer/cups.pm +++ b/perl-install/printer/cups.pm @@ -29,13 +29,15 @@ sub lpstat_lpv() { for my $line (@lpstat) { chomp($line); if ($line !~ m!^\s*$!) { - if ($line =~ m!^printer\s+(\S+)\s+(\S.*)$!) { + if ($line =~ m!^printer\s+(\S+)\s+.*\b(enabled|disabled)\b!) { # Beginning of new printer's entry my $name = $1; + my $state = $2; push(@items, {}); $currentitem = $#items; $itemshash->{$name} = $currentitem; $items[$currentitem]{queuename} ||= $name; + $items[$currentitem]{state} ||= $state; } elsif ($line =~ m!^\s+Description:\s+(\S.*)$!) { # Description field if ($currentitem != -1) { -- cgit v1.2.1