From 1bdf96d3aa8d9a0a20c2219e1c550edb67636478 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 6 Sep 2007 09:16:11 +0000 Subject: (get_summary) split it out of format_pkg_simplifiedinfo() --- Rpmdrake/gui.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Rpmdrake') diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm index c7badbfa..63ae91af 100644 --- a/Rpmdrake/gui.pm +++ b/Rpmdrake/gui.pm @@ -69,6 +69,12 @@ sub compute_main_window_size { $typical_width < 150 and $typical_width = 150; } +sub get_summary { + my ($key) = @_; + my $summary = translate(to_utf8($pkgs->{$key}{summary})); + utf8::valid($summary) ? $summary : (); +} + sub format_pkg_simplifiedinfo { my ($pkgs, $key, $urpm, $descriptions) = @_; @@ -76,8 +82,8 @@ sub format_pkg_simplifiedinfo { my $raw_medium = pkg2medium($pkgs->{$key}{pkg}, $urpm); my $medium = $raw_medium ? $raw_medium->{name} : undef; my $update_descr = $pkgs->{$key}{pkg}->flag_upgrade && $descriptions->{$name}{pre} && $descriptions->{$name}{medium} eq $medium; - my $summary = translate(to_utf8($pkgs->{$key}{summary})); - my $s = ugtk2::markup_to_TextView_format(join("\n", format_header(join(' - ', $name, (utf8::valid($summary) ? $summary : ()))) . + my $summary = get_summary($key); + my $s = ugtk2::markup_to_TextView_format(join("\n", format_header(join(' - ', $name, $summary)) . # workaround gtk+ bug where GtkTextView wronly limit embedded widget size to bigger line's width (#25533): "\x{200b} \x{feff}" . ' ' x 120, if_($update_descr, # is it an update? -- cgit v1.2.1