aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-02-26 15:44:25 +0000
committerThierry Vignaud <tv@mandriva.org>2008-02-26 15:44:25 +0000
commit68b3cb36c4c74aaf1b8ef0d2dedec5ff44f4293f (patch)
treef4bcb4c804f6e520d4f5a164e9f79bddf87c5a34
parent04261fe702496c9f64c37586dd02be7db89279b3 (diff)
downloadrpmdrake-68b3cb36c4c74aaf1b8ef0d2dedec5ff44f4293f.tar
rpmdrake-68b3cb36c4c74aaf1b8ef0d2dedec5ff44f4293f.tar.gz
rpmdrake-68b3cb36c4c74aaf1b8ef0d2dedec5ff44f4293f.tar.bz2
rpmdrake-68b3cb36c4c74aaf1b8ef0d2dedec5ff44f4293f.tar.xz
rpmdrake-68b3cb36c4c74aaf1b8ef0d2dedec5ff44f4293f.zip
(run_treeview_dialog) factorize column list
-rwxr-xr-xrpmdrake8
1 files changed, 5 insertions, 3 deletions
diff --git a/rpmdrake b/rpmdrake
index 71c9e832..ed38782b 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -236,6 +236,8 @@ sub run_treeview_dialog {
$col_sel->set_sizing('fixed');
$col_sel->set_sort_column_id($pkg_columns{selected});
+ my @columns = qw(name version release), if_($display_arch_col, 'arch');
+
my %columns = (
'name' => {
title => N("Package"),
@@ -256,7 +258,7 @@ sub run_treeview_dialog {
text => $pkg_columns{arch},
},
);
- foreach my $col (@columns{qw(name version release arch)}) {
+ foreach my $col (@columns{@columns}) {
$detail_list->append_column(
$col->{widget} =
Gtk2::TreeViewColumn->new_with_attributes(' ' . $col->{title} . ' ',
@@ -266,10 +268,10 @@ sub run_treeview_dialog {
);
$col->{widget}->set_sort_column_id($col->{markup} ? $col->{markup} : $col->{text});
}
- $columns{$_}{widget}->set_sizing('autosize') foreach qw(name version release arch);
+ $columns{$_}{widget}->set_sizing('autosize') foreach @columns;
$columns{name}{widget}->set_property('expand', '1');
$columns{name}{renderer}->set_property('ellipsize', 'end');
- $columns{$_}{renderer}->set_property('xpad', '6') foreach qw(name version release arch);
+ $columns{$_}{renderer}->set_property('xpad', '6') foreach @columns;
$columns{name}{widget}->set_resizable(1);
$detail_list_model->set_sort_column_id($pkg_columns{text}, 'ascending');
$detail_list_model->set_sort_func($pkg_columns{version}, \&sort_callback);