[Vala] detect mounted volumes




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all:

I need to detect when a new USB disk has been mounted or unmounted.
Currently I use VolumeMonitor.get() to acquire a VolumeMonitor
instance and list the volumes (using get_root().get_path() to get the
mounting path), but I want to do it in a more dynamic fashion,
detecting when the user inserts or removes a media and automagically
refreshing the list then, instead of forcing the user to click a
button to refresh it.

The problem is that I don't know how to do it. Drive_changed and
volume_changed signals are triggered before the volume is mounted by
nautilus, and mount_changed never happens :? If I send the order to
mount a volume when I receive its volume_added signal, nautilus
returns an error when it tries to mount it, because the operation is
already being made.

So, how can I detect when a new volume has been mounted?

Thanks.

- -- 
Nos leemos
                 RASTER    (Linux user #228804)
raster rastersoft com              http://www.rastersoft.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk5GZaAACgkQXEZvyfy1ha8HPwCeJfusESX9Dd1dirFRIa1GGnki
tl8AnAugxQ5VqBVyOgReZLwXmdPs9xQj
=HyXa
-----END PGP SIGNATURE-----




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]