diff options
author | Thierry Vignaud <tv@mandriva.org> | 2007-09-06 09:16:11 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2007-09-06 09:16:11 +0000 |
commit | 1bdf96d3aa8d9a0a20c2219e1c550edb67636478 (patch) | |
tree | 43d3e4b20088d44fdb98a2cc74f392ee32b68b2f /Rpmdrake | |
parent | 7cbc1a5c906d45e345d61196fd0a6214790af104 (diff) | |
download | rpmdrake-1bdf96d3aa8d9a0a20c2219e1c550edb67636478.tar rpmdrake-1bdf96d3aa8d9a0a20c2219e1c550edb67636478.tar.gz rpmdrake-1bdf96d3aa8d9a0a20c2219e1c550edb67636478.tar.bz2 rpmdrake-1bdf96d3aa8d9a0a20c2219e1c550edb67636478.tar.xz rpmdrake-1bdf96d3aa8d9a0a20c2219e1c550edb67636478.zip |
(get_summary) split it out of format_pkg_simplifiedinfo()
Diffstat (limited to 'Rpmdrake')
-rw-r--r-- | Rpmdrake/gui.pm | 10 |
1 files changed, 8 insertions, 2 deletions
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? |