### Class

# Gio VolumeMonitor

#### Description [src]

    class Gio.VolumeMonitor : GObject.Object
    {
      /* No available fields */
    }

`GVolumeMonitor` is for listing the user interesting devices and volumes on the computer. In other words, what a file selector or file manager would show in a sidebar.

`GVolumeMonitor` is not thread-default-context aware (see `g_main_context_push_thread_default()`), and so should not be used other than from the main thread, with no thread-default-context active.

In order to receive updates about volumes and mounts monitored through GVFS, a main loop must be running.

#### Hierarchy

#### Ancestors

- GObject

#### Descendants

- GNativeVolumeMonitor

#### Functions

###### g_volume_monitor_adopt_orphan_mount

This function should be called by any `GVolumeMonitor` implementation when a new `GMount` object is created that is not associated with a `GVolume` object. It must be called just before emitting the `mount_added` signal.

deprecated: 2.20

###### g_volume_monitor_get

Gets the volume monitor used by gio.

#### Instance methods

###### g_volume_monitor_get_connected_drives

Gets a list of drives connected to the system.

###### g_volume_monitor_get_mount_for_uuid

Finds a `GMount` object by its UUID (see g_mount_get_uuid()).

###### g_volume_monitor_get_mounts

Gets a list of the mounts on the system.

###### g_volume_monitor_get_volume_for_uuid

Finds a `GVolume` object by its UUID (see g_volume_get_uuid()).

###### g_volume_monitor_get_volumes

Gets a list of the volumes on the system.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Signals

###### Gio.VolumeMonitor::drive-changed

Emitted when a drive changes.

###### Gio.VolumeMonitor::drive-connected

Emitted when a drive is connected to the system.

###### Gio.VolumeMonitor::drive-disconnected

Emitted when a drive is disconnected from the system.

###### Gio.VolumeMonitor::drive-eject-button

Emitted when the eject button is pressed on `drive`.

since: 2.18

###### Gio.VolumeMonitor::drive-stop-button

Emitted when the stop button is pressed on `drive`.

since: 2.22

###### Gio.VolumeMonitor::mount-added

Emitted when a mount is added.

###### Gio.VolumeMonitor::mount-changed

Emitted when a mount changes.

###### Gio.VolumeMonitor::mount-pre-unmount

May be emitted when a mount is about to be removed.

###### Gio.VolumeMonitor::mount-removed

Emitted when a mount is removed.

###### Gio.VolumeMonitor::volume-added

Emitted when a mountable volume is added to the system.

###### Gio.VolumeMonitor::volume-changed

Emitted when mountable volume is changed.

###### Gio.VolumeMonitor::volume-removed

Emitted when a mountable volume is removed from the system.

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct GioVolumeMonitorClass {
      GObjectClass parent_class;
      void (* volume_added) (
        GVolumeMonitor* volume_monitor,
        GVolume* volume
      );
      void (* volume_removed) (
        GVolumeMonitor* volume_monitor,
        GVolume* volume
      );
      void (* volume_changed) (
        GVolumeMonitor* volume_monitor,
        GVolume* volume
      );
      void (* mount_added) (
        GVolumeMonitor* volume_monitor,
        GMount* mount
      );
      void (* mount_removed) (
        GVolumeMonitor* volume_monitor,
        GMount* mount
      );
      void (* mount_pre_unmount) (
        GVolumeMonitor* volume_monitor,
        GMount* mount
      );
      void (* mount_changed) (
        GVolumeMonitor* volume_monitor,
        GMount* mount
      );
      void (* drive_connected) (
        GVolumeMonitor* volume_monitor,
        GDrive* drive
      );
      void (* drive_disconnected) (
        GVolumeMonitor* volume_monitor,
        GDrive* drive
      );
      void (* drive_changed) (
        GVolumeMonitor* volume_monitor,
        GDrive* drive
      );
      gboolean (* is_supported) (
    void
      );
      GList* (* get_connected_drives) (
        GVolumeMonitor* volume_monitor
      );
      GList* (* get_volumes) (
        GVolumeMonitor* volume_monitor
      );
      GList* (* get_mounts) (
        GVolumeMonitor* volume_monitor
      );
      GVolume* (* get_volume_for_uuid) (
        GVolumeMonitor* volume_monitor,
        const char* uuid
      );
      GMount* (* get_mount_for_uuid) (
        GVolumeMonitor* volume_monitor,
        const char* uuid
      );
      GVolume* (* adopt_orphan_mount) (
        GMount* mount,
        GVolumeMonitor* volume_monitor
      );
      void (* drive_eject_button) (
        GVolumeMonitor* volume_monitor,
        GDrive* drive
      );
      void (* drive_stop_button) (
        GVolumeMonitor* volume_monitor,
        GDrive* drive
      );
      void (* _g_reserved1) (
    void
      );
      void (* _g_reserved2) (
    void
      );
      void (* _g_reserved3) (
    void
      );
      void (* _g_reserved4) (
    void
      );
      void (* _g_reserved5) (
    void
      );
      void (* _g_reserved6) (
    void
      );

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.

`volume_added: void (* volume_added) ( GVolumeMonitor* volume_monitor, GVolume* volume )`

  No description available.

`volume_removed: void (* volume_removed) ( GVolumeMonitor* volume_monitor, GVolume* volume )`

  No description available.

`volume_changed: void (* volume_changed) ( GVolumeMonitor* volume_monitor, GVolume* volume )`

  No description available.

`mount_added: void (* mount_added) ( GVolumeMonitor* volume_monitor, GMount* mount )`

  No description available.

`mount_removed: void (* mount_removed) ( GVolumeMonitor* volume_monitor, GMount* mount )`

  No description available.

`mount_pre_unmount: void (* mount_pre_unmount) ( GVolumeMonitor* volume_monitor, GMount* mount )`

  No description available.

`mount_changed: void (* mount_changed) ( GVolumeMonitor* volume_monitor, GMount* mount )`

  No description available.

`drive_connected: void (* drive_connected) ( GVolumeMonitor* volume_monitor, GDrive* drive )`

  No description available.

`drive_disconnected: void (* drive_disconnected) ( GVolumeMonitor* volume_monitor, GDrive* drive )`

  No description available.

`drive_changed: void (* drive_changed) ( GVolumeMonitor* volume_monitor, GDrive* drive )`

  No description available.

`is_supported: gboolean (* is_supported) ( void )`

  No description available.

`get_connected_drives: GList* (* get_connected_drives) ( GVolumeMonitor* volume_monitor )`

  No description available.

`get_volumes: GList* (* get_volumes) ( GVolumeMonitor* volume_monitor )`

  No description available.

`get_mounts: GList* (* get_mounts) ( GVolumeMonitor* volume_monitor )`

  No description available.

`get_volume_for_uuid: GVolume* (* get_volume_for_uuid) ( GVolumeMonitor* volume_monitor, const char* uuid )`

  No description available.

`get_mount_for_uuid: GMount* (* get_mount_for_uuid) ( GVolumeMonitor* volume_monitor, const char* uuid )`

  No description available.

`adopt_orphan_mount: GVolume* (* adopt_orphan_mount) ( GMount* mount, GVolumeMonitor* volume_monitor )`

  No description available.

`drive_eject_button: void (* drive_eject_button) ( GVolumeMonitor* volume_monitor, GDrive* drive )`

  No description available.

`drive_stop_button: void (* drive_stop_button) ( GVolumeMonitor* volume_monitor, GDrive* drive )`

  No description available.

`_g_reserved1: void (* _g_reserved1) ( void )`

  No description available.

`_g_reserved2: void (* _g_reserved2) ( void )`

  No description available.

`_g_reserved3: void (* _g_reserved3) ( void )`

  No description available.

`_g_reserved4: void (* _g_reserved4) ( void )`

  No description available.

`_g_reserved5: void (* _g_reserved5) ( void )`

  No description available.

`_g_reserved6: void (* _g_reserved6) ( void )`

  No description available.

#### Virtual methods

###### Gio.VolumeMonitorClass.drive_changed

No description available.

###### Gio.VolumeMonitorClass.drive_connected

No description available.

###### Gio.VolumeMonitorClass.drive_disconnected

No description available.

###### Gio.VolumeMonitorClass.drive_eject_button

No description available.

###### Gio.VolumeMonitorClass.drive_stop_button

No description available.

###### Gio.VolumeMonitorClass.get_connected_drives

Gets a list of drives connected to the system.

###### Gio.VolumeMonitorClass.get_mount_for_uuid

Finds a `GMount` object by its UUID (see g_mount_get_uuid()).

###### Gio.VolumeMonitorClass.get_mounts

Gets a list of the mounts on the system.

###### Gio.VolumeMonitorClass.get_volume_for_uuid

Finds a `GVolume` object by its UUID (see g_volume_get_uuid()).

###### Gio.VolumeMonitorClass.get_volumes

Gets a list of the volumes on the system.

###### Gio.VolumeMonitorClass.mount_added

No description available.

###### Gio.VolumeMonitorClass.mount_changed

No description available.

###### Gio.VolumeMonitorClass.mount_pre_unmount

No description available.

###### Gio.VolumeMonitorClass.mount_removed

No description available.

###### Gio.VolumeMonitorClass.volume_added

No description available.

###### Gio.VolumeMonitorClass.volume_changed

No description available.

###### Gio.VolumeMonitorClass.volume_removed

No description available.