From 0bf35d9e4eb8f712211b2805b76c273b1cc56049 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 14 Mar 2008 17:51:28 +0000 Subject: bless network::connection_manager objects --- lib/network/connection_manager.pm | 8 +++++--- lib/network/drakroam.pm | 2 +- lib/network/netcenter.pm | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/network/connection_manager.pm b/lib/network/connection_manager.pm index 9d6145f..cb24859 100644 --- a/lib/network/connection_manager.pm +++ b/lib/network/connection_manager.pm @@ -28,9 +28,11 @@ sub create_pixbufs() { }; } -sub create { - my ($in, $net, $w, $pixbufs) = @_; - { in => $in, net => $net, gui => { w => $w, pixbufs => $pixbufs } }; +sub new { + my ($class, $in, $net, $w, $pixbufs) = @_; + bless { + in => $in, net => $net, gui => { w => $w, pixbufs => $pixbufs }, + }, $class; } sub set_connection { diff --git a/lib/network/drakroam.pm b/lib/network/drakroam.pm index 7d499c5..71d7deb 100755 --- a/lib/network/drakroam.pm +++ b/lib/network/drakroam.pm @@ -134,7 +134,7 @@ sub main { $::main_window = $w->{real_window}; my $pixbufs = network::connection_manager::create_pixbufs(); - my $droam = network::connection_manager::create($in, $net, $w, $pixbufs); + my $droam = network::connection_manager->new($in, $net, $w, $pixbufs); network::connection_manager::create_networks_list($droam); create_drakroam_gui($droam, $dbus, $title, $icon); diff --git a/lib/network/netcenter.pm b/lib/network/netcenter.pm index 05e7954..9f15856 100755 --- a/lib/network/netcenter.pm +++ b/lib/network/netcenter.pm @@ -15,7 +15,7 @@ use network::tools; sub build_cmanager { my ($in, $net, $w, $pixbufs, $connection) = @_; - my $cmanager = network::connection_manager::create($in, $net, $w, $pixbufs); + my $cmanager = network::connection_manager->new($in, $net, $w, $pixbufs); network::connection_manager::set_connection($cmanager, $connection); if ($connection->can('get_networks')) { -- cgit v1.2.1