From 1638144c728d327fe3587ca133efcd1ab347e9ae Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Sun, 29 Jan 2012 03:28:48 +0000 Subject: (new,list,wait_for_insert,wait_for_mounted) connect to udisks instead of HAL --- Changes | 2 ++ lib/Hal/Cdroms.pm | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Changes b/Changes index 826cc19..bdf145f 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ + - switch from HAL to udisks (mga#3458 & #3639) + 0.03 Mon Mar 3 19:09:06 CET 2008 - ->mount and ->umount now work even the cdrom is listed in fstab, diff --git a/lib/Hal/Cdroms.pm b/lib/Hal/Cdroms.pm index 491bfa5..5a8ff38 100644 --- a/lib/Hal/Cdroms.pm +++ b/lib/Hal/Cdroms.pm @@ -44,7 +44,7 @@ Access cdroms through HAL and D-Bus. =cut # internal constant -my $hal_dn = 'org.freedesktop.Hal'; +my $hal_dn = 'org.freedesktop.UDisks'; =head2 Hal::Cdroms->new @@ -73,8 +73,8 @@ Returns the list of C of the cdroms (mounted or not). sub list { my ($o) = @_; - my $manager = $o->{hal}->get_object("/org/freedesktop/Hal/Manager", - "$hal_dn.Manager"); + my $manager = $o->{hal}->get_object("/org/freedesktop/UDisks", + $hal_dn); @{$manager->FindDeviceByCapability('volume.disc')}; } @@ -235,7 +235,7 @@ You can give an optional timeout in milliseconds. sub wait_for_insert { my ($o, $o_timeout) = @_; - _reactor_wait($o->{dbus}, "$hal_dn.Manager", $o_timeout, sub { + _reactor_wait($o->{dbus}, $hal_dn, $o_timeout, sub { my ($msg) = @_; $msg->get_member eq 'DeviceAdded' && ($msg->get_args_list)[0]; }); @@ -253,7 +253,7 @@ You can give an optional timeout in milliseconds. sub wait_for_mounted { my ($o, $o_timeout) = @_; - _reactor_wait($o->{dbus}, "$hal_dn.Device", $o_timeout, sub { + _reactor_wait($o->{dbus}, $hal_dn, $o_timeout, sub { my ($msg) = @_; $msg->get_member eq 'PropertyModified' or return; -- cgit v1.2.1