summaryrefslogtreecommitdiffstats
path: root/lib/network/netcenter.pm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-03-05 20:39:57 +0000
committerOlivier Blin <oblin@mandriva.com>2008-03-05 20:39:57 +0000
commit1b58f7f03680c3262c479be6206633dbc2ab4525 (patch)
tree74f8a4aaedebf1efea15f171e9a33cc140e19e40 /lib/network/netcenter.pm
parent96dec68926084eb37dce0ef9f451af336526e02b (diff)
downloaddrakx-net-1b58f7f03680c3262c479be6206633dbc2ab4525.tar
drakx-net-1b58f7f03680c3262c479be6206633dbc2ab4525.tar.gz
drakx-net-1b58f7f03680c3262c479be6206633dbc2ab4525.tar.bz2
drakx-net-1b58f7f03680c3262c479be6206633dbc2ab4525.tar.xz
drakx-net-1b58f7f03680c3262c479be6206633dbc2ab4525.zip
do not show duplicate interfaces when the matching device can't be found
Diffstat (limited to 'lib/network/netcenter.pm')
-rwxr-xr-xlib/network/netcenter.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/network/netcenter.pm b/lib/network/netcenter.pm
index e1babfe..025b145 100755
--- a/lib/network/netcenter.pm
+++ b/lib/network/netcenter.pm
@@ -40,8 +40,12 @@ sub main {
$w->show;
my $wait = $in->wait_message(N("Please wait"), N("Please wait"));
- my @connections = map { $_->get_connections(automatic_only => 1, fast_only => 1) } network::connection::get_types;
- @connections = uniq_ { $_->{device} } @connections;
+ my @all_connections = map { $_->get_connections(automatic_only => 1, fast_only => 1) } network::connection::get_types;
+ my ($intf, $no_intf) = partition { exists $_->{device}{interface} } @all_connections;
+ my @connections = (
+ (uniq_ { $_->{device} } @$no_intf),
+ (uniq_ { $_->{device}{interface} } @$intf)
+ );
my $pixbufs = network::connection_manager::create_pixbufs();
my @cmanagers = map { build_cmanager($in, $net, $w, $pixbufs, $_) } @connections;