summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-11-13 19:02:26 +0000
committerOlivier Blin <oblin@mandriva.com>2008-11-13 19:02:26 +0000
commit0dc93fb7b03f4fd54bfab485a04287c810d57593 (patch)
tree72ec67d852ff23f910200c548e1078d8254c3037 /lib
parent30e33b9b8ef6eaaaaa3708b46f477f5552078b0f (diff)
downloaddrakx-net-0dc93fb7b03f4fd54bfab485a04287c810d57593.tar
drakx-net-0dc93fb7b03f4fd54bfab485a04287c810d57593.tar.gz
drakx-net-0dc93fb7b03f4fd54bfab485a04287c810d57593.tar.bz2
drakx-net-0dc93fb7b03f4fd54bfab485a04287c810d57593.tar.xz
drakx-net-0dc93fb7b03f4fd54bfab485a04287c810d57593.zip
use cmp operator
Diffstat (limited to 'lib')
-rw-r--r--lib/network/connection_manager.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/network/connection_manager.pm b/lib/network/connection_manager.pm
index 5b77c5e..003dcbb 100644
--- a/lib/network/connection_manager.pm
+++ b/lib/network/connection_manager.pm
@@ -14,6 +14,7 @@ use network::network;
use network::tools;
use network::connection;
use modules;
+use locale; # for cmp
sub create_pixbufs() {
{
@@ -278,9 +279,9 @@ sub create_networks_list {
$cmanager->{gui}{networks_list}->get_column(1)->set_sort_column_id(1);
$cmanager->{gui}{networks_list}->get_model->set_sort_func (1, sub {
my ($sortable, $iter_left, $iter_right) = @_;
- my $s1 = lc $sortable->get($iter_left, 2);
- my $s2 = lc $sortable->get($iter_right, 2);
- return $s1 eq $s2?0:($s1 gt $s2?1:-1);
+ my $s1 = $sortable->get($iter_left, 2);
+ my $s2 = $sortable->get($iter_right, 2);
+ return $s1 cmp $s2;
});
$cmanager->{gui}{networks_list}->get_column(2)->set_sort_column_id(2);
$cmanager->{gui}{networks_list}->get_model->set_sort_func (2, sub {
@@ -295,7 +296,7 @@ sub create_networks_list {
my $s1 = $cmanager->{connection}{networks}{$sortable->get($iter_left, 0)}->{flags};
my $s2 = $cmanager->{connection}{networks}{$sortable->get($iter_right, 0)}->{flags};
#FIXME Should define an explicit order OPEN < WEP < WPA
- return $s1 eq $s2?0:($s1 lt $s2?1:-1);
+ return $s1 cmp $s2;
});
}