diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-10-15 12:52:13 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-10-15 12:52:13 +0000 |
commit | 7cbc4bf960c493efcb5640500fabdd5232d6b190 (patch) | |
tree | b5a6cf0ceacd2b084c9ebfbc34124755f333901f /lib | |
parent | 217c8b09f3c5661062996b6f978fb9d84521d9d7 (diff) | |
download | drak3d-7cbc4bf960c493efcb5640500fabdd5232d6b190.tar drak3d-7cbc4bf960c493efcb5640500fabdd5232d6b190.tar.gz drak3d-7cbc4bf960c493efcb5640500fabdd5232d6b190.tar.bz2 drak3d-7cbc4bf960c493efcb5640500fabdd5232d6b190.tar.xz drak3d-7cbc4bf960c493efcb5640500fabdd5232d6b190.zip |
extract filter_installed_types function (to be used in drakxtools)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Xconfig/glx.pm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Xconfig/glx.pm b/lib/Xconfig/glx.pm index ceb5bd3..5a8034c 100644 --- a/lib/Xconfig/glx.pm +++ b/lib/Xconfig/glx.pm @@ -188,13 +188,18 @@ sub detect_types { \@available_types, $type; } +sub filter_installed_types { + my ($types) = @_; + grep { + !$_->{wms} || -e '/usr/bin/' . first(@{$_->{wms}}) + } @$types; +} + sub choose_interactive { my ($in, $glx, $o_installed_only) = @_; my ($available, $type) = detect_types($glx); - @$available = grep { - !$_->{wms} || -e '/usr/bin/' . first(@{$_->{wms}}) - } @$available if $o_installed_only; + @$available = filter_installed_types($available) if $o_installed_only; $in->ask_from_({ title => N("3D Desktop effects") }, [ { label => N("3D Desktop effects"), title => 1 }, |