Some problems with signals

David Zeuthen david at fubar.dk
Tue Jul 17 08:49:59 PDT 2007


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