Some problems with signals

Daniel Machado cdanielmachado at gmail.com
Tue Jul 17 09:21:10 PDT 2007


I actually did it as you describe and it's working.
I don't assume the device is mounted until I receive the
PropertyModified signal, and check that the mount_point property is
defined.

Thanks,
Daniel

On 7/17/07, David Zeuthen <david at fubar.dk> wrote:
> On Thu, 2007-07-12 at 16:44 +0100, Daniel Machado wrote:
> > The problem is that HAL never sends the Condition signal when I mount
> > or unmount the volume. Although it works for the PropertyModified
> > signal.
> > Is there a reason for this?
>
> I think we removed the DeviceCondition signals. Just listen to
> PropertyModified instead.
>
> > I'm also curious about the mountpoint.
> > When the device is added, and I check that it is a volume, I consult
> > the volume.mount_point property.
> > Sometimes it returns the mountpoint, sometimes it doesn't. (It always
> > does if I sleep some seconds before consulting). I'm guessing that
> > sometimes the application executes faster than the delay between
> > attaching and mounting the device.
> >
> > Is there a "clean" way to avoid this? One that doesn't involve
> > repeatedly sleeping and checking for the properties until it's ok.
>
> No, it's just the way it works. The way to think about it is that it's
> an event driven program. Like most other things. You also cannot make
> assumptions that the media will get mounted at all - maybe the user
> disabled auto mounting, maybe the user need to put in a password to
> mount the data etc.
>
> Hope this helps.
>
>       David
>
>
>


More information about the hal mailing list