From 1b58f7f03680c3262c479be6206633dbc2ab4525 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 5 Mar 2008 20:39:57 +0000 Subject: do not show duplicate interfaces when the matching device can't be found --- lib/network/netcenter.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/network') 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; -- cgit v1.2.1