From a8111ada7f12b135d6abf5b6d86084b3377da08c Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 8 Jun 2007 00:09:22 +0000 Subject: (search_windows_font) simplify it by puting error management out of loop --- perl-install/standalone/drakfont | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'perl-install/standalone') diff --git a/perl-install/standalone/drakfont b/perl-install/standalone/drakfont index 97af4f1a4..5f85e347b 100755 --- a/perl-install/standalone/drakfont +++ b/perl-install/standalone/drakfont @@ -209,17 +209,12 @@ sub search_windows_font() { } } my $nb_dir = @fonts; + if (!$nb_dir) { + err_dialog(N("Error"), N("No fonts found")); + return 0; + } foreach my $font (@fonts) { - foreach my $i (@{ $_->[0] }) { - if ($interactive) { - if ($nb_dir) { - progress($pbar, 0.25 / $nb_dir, N("parse all fonts")); - } else { - err_dialog(N("Error"), N("No fonts found")); - return 0; - } - } - + progress($pbar, 0.25 / $nb_dir, N("parse all fonts")); my $font_name = basename($font); !$replace && any { /^$font_name$/ } @installed_fonts and next; any { /^$font_name$/ } @font_list or push @font_list, $font; -- cgit v1.2.1