From eb2a6cd10f761903cea4a4e7c6dcf7686bce2392 Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Wed, 24 Aug 2005 13:03:38 +0000 Subject: - Fixed problem of current printer/driver not chosen in printer/driver list when choosing "Printer manufacturer, model, driver" in the printer editing menu (occured mainly in expert mode and with printers with manufacturer-supplied PPD). --- perl-install/printer/printerdrake.pm | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'perl-install/printer') diff --git a/perl-install/printer/printerdrake.pm b/perl-install/printer/printerdrake.pm index e998c7d18..ea67cd001 100644 --- a/perl-install/printer/printerdrake.pm +++ b/perl-install/printer/printerdrake.pm @@ -3093,8 +3093,12 @@ sub get_db_entry { $printer->{DBENTRY} = "$make|$model"; } $printer->{OLD_CHOICE} = $printer->{DBENTRY}; - } elsif ($printer->{configured}{$queue}{queuedata}{ppd}) { - # Do we have a native CUPS driver or a PostScript PPD file? + } + if ($printer->{configured}{$queue}{queuedata}{ppd} || + ($printer->{DBENTRY} eq "") || + !exists($printer::main::thedb{$printer->{DBENTRY}})) { + # Do we have a native CUPS driver, a PostScript PPD file, + # or a pre-built Foomatic PPD file? $printer->{DBENTRY} = printer::main::get_descr_from_ppd($printer) || $printer->{DBENTRY}; @@ -3104,7 +3108,8 @@ sub get_db_entry { $printer->{OLD_CHOICE} = $printer->{DBENTRY}; } my ($make, $model); - if ($printer->{DBENTRY} eq "") { + if (($printer->{DBENTRY} eq "") || + !exists($printer::main::thedb{$printer->{DBENTRY}})) { # Point the list cursor at least to manufacturer and model of # the printer $printer->{DBENTRY} = ""; @@ -3127,7 +3132,8 @@ sub get_db_entry { } } } - if ($printer->{DBENTRY} eq "") { + if (($printer->{DBENTRY} eq "") || + !exists($printer::main::thedb{$printer->{DBENTRY}})) { # Exact match of make and model did not work, try to clean # up the model name $model =~ s/PS//; @@ -3140,7 +3146,9 @@ sub get_db_entry { } } } - if ($printer->{DBENTRY} eq "" && $make ne "") { + if ((($printer->{DBENTRY} eq "") || + !exists($printer::main::thedb{$printer->{DBENTRY}})) && + $make ne "") { # Exact match with cleaned-up model did not work, try a best match my $matchstr = "$make|$model"; $printer->{DBENTRY} = @@ -3153,7 +3161,8 @@ sub get_db_entry { $matchstr !~ /Hewlett[\s-]+Packard/i)) { $printer->{DBENTRY} = "" } } - if ($printer->{DBENTRY} eq "") { + if (($printer->{DBENTRY} eq "") || + !exists($printer::main::thedb{$printer->{DBENTRY}})) { # Set the OLD_CHOICE to a non-existing value $printer->{OLD_CHOICE} = "XXX"; } -- cgit v1.2.1