From a19ee1313d2e05bb0d334ef2c5912bf98489ea31 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 1 Oct 2012 16:17:05 +0000 Subject: rename 'hal_cdroms' as 'cdroms' since we no longuer use Hal --- lib/Hal/Cdroms.pm | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/Hal/Cdroms.pm b/lib/Hal/Cdroms.pm index 454a67e..17fbc9e 100644 --- a/lib/Hal/Cdroms.pm +++ b/lib/Hal/Cdroms.pm @@ -26,15 +26,15 @@ Hal::Cdroms - access cdroms through HAL and D-Bus use Hal::Cdroms; - my $hal_cdroms = Hal::Cdroms->new; + my $cdroms = Hal::Cdroms->new; - foreach my $hal_path ($hal_cdroms->list) { - my $m = $hal_cdroms->get_mount_point($hal_path); + foreach my $hal_path ($cdroms->list) { + my $m = $cdroms->get_mount_point($hal_path); print "$hal_path ", $m ? "is mounted in $m" : "is not mounted", "\n"; } - my $hal_path = $hal_cdroms->wait_for_insert; - my $m = $hal_cdroms->mount($hal_path); + my $hal_path = $cdroms->wait_for_insert; + my $m = $cdroms->mount($hal_path); print "$hal_path is now mounted in $m\n"; =head1 DESCRIPTION @@ -64,7 +64,7 @@ sub new { bless { dbus => $dbus, service => $service }, $class; } -=head2 $hal_cdroms->list +=head2 $cdroms->list Returns the list of C of the cdroms (mounted or not). @@ -80,7 +80,7 @@ sub list { grep { _GetProperty(_get_device($o, $_), 'DeviceIsOpticalDisc') } @{$manager->EnumerateDevices}; } -=head2 $hal_cdroms->get_mount_point($hal_path) +=head2 $cdroms->get_mount_point($hal_path) Return the mount point associated to the C, or undef it is not mounted. @@ -125,10 +125,10 @@ sub _try { } } -=head2 $hal_cdroms->ensure_mounted($hal_path) +=head2 $cdroms->ensure_mounted($hal_path) Mount the C if not already mounted. -Return the mount point associated to the C, or undef it cannot be mounted successfully (see $hal_cdroms->{error}). +Return the mount point associated to the C, or undef it cannot be mounted successfully (see $cdroms->{error}). =cut @@ -141,10 +141,10 @@ sub ensure_mounted { } -=head2 $hal_cdroms->mount_through_hal($hal_path) +=head2 $cdroms->mount_through_hal($hal_path) Mount the C through HAL -Return the mount point associated to the C, or undef it cannot be mounted successfully (see $hal_cdroms->{error}). +Return the mount point associated to the C, or undef it cannot be mounted successfully (see $cdroms->{error}). If the cdrom is listed in fstab, HAL will refuse to mount it. =cut @@ -159,10 +159,10 @@ sub mount_hal { $mountpoint; } -=head2 $hal_cdroms->mount($hal_path) +=head2 $cdroms->mount($hal_path) Mount the C through HAL or fallback to plain mount(8). -Return the mount point associated to the C, or undef it cannot be mounted successfully (see $hal_cdroms->{error}) +Return the mount point associated to the C, or undef it cannot be mounted successfully (see $cdroms->{error}) =cut @@ -193,9 +193,9 @@ sub _fstab_devices() { map { /(\S+)/ } <$F>; } -=head2 $hal_cdroms->unmount($hal_path) +=head2 $cdroms->unmount($hal_path) -Unmount the C. Return true on success (see $hal_cdroms->{error} on failure) +Unmount the C. Return true on success (see $cdroms->{error} on failure) If the cdrom is listed in not mounted by HAL, HAL will refuse to unmount it. =cut @@ -207,10 +207,10 @@ sub unmount_hal { _try($o, sub { $volume->FilesystemUnmount([]) }); } -=head2 $hal_cdroms->unmount($hal_path) +=head2 $cdroms->unmount($hal_path) Unmount the C through HAL or fallback on umount(8). -Return true on success (see $hal_cdroms->{error} on failure) +Return true on success (see $cdroms->{error} on failure) =cut @@ -222,9 +222,9 @@ sub unmount { system('umount', get_mount_point($o, $hal_path)) == 0; } -=head2 $hal_cdroms->eject($hal_path) +=head2 $cdroms->eject($hal_path) -Ejects the C. Return true on success (see $hal_cdroms->{error} on failure) +Ejects the C. Return true on success (see $cdroms->{error} on failure) =cut @@ -235,7 +235,7 @@ sub eject { _try($o, sub { $volume->FilesystemUnmount([]); $volume->DriveEject([]) }); } -=head2 $hal_cdroms->wait_for_insert([$timeout]) +=head2 $cdroms->wait_for_insert([$timeout]) Waits until a cdrom is inserted. Returns the inserted C on success. Otherwise returns undef. @@ -257,7 +257,7 @@ sub wait_for_insert { }); } -=head2 $hal_cdroms->wait_for_mounted([$timeout]) +=head2 $cdroms->wait_for_mounted([$timeout]) Waits until a cdrom is inserted and mounted by a volume manager (eg: gnome-volume-manager). Returns the mounted C on success. Otherwise returns undef. -- cgit v1.2.1