1.104 <GVolumeMonitor>

Class: <GVolumeMonitor>

It derives from <GObject>.

<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 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.

Fields

parent-instance

Procedures

Procedure: volume-monitor:adopt-orphan-mount mount ⇒ %return

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.

If the return value is not #f, the caller must associate the returned <GVolume> object with the <GMount>. This involves returning it in its mount:get-volume implementation. The caller must also listen for the "removed" signal on the returned object and give up its reference when handling that signal

Similarly, if implementing volume-monitor:adopt-orphan-mount, the implementor must take a reference to mount and return it in its volume:get-mount implemented. Also, the implementor must listen for the "unmounted" signal on mount and give up its reference upon handling that signal.

There are two main use cases for this function.

One is when implementing a user space file system driver that reads blocks of a block device that is already represented by the native volume monitor (for example a CD Audio file system driver). Such a driver will generate its own <GMount> object that needs to be associated with the <GVolume> object that represents the volume.

The other is for implementing a <GVolumeMonitor> whose sole purpose is to return <GVolume> objects representing entries in the users "favorite servers" list or similar.

mount

Passed: a <GMount>.

a <GMount> object to find a parent for

%return

Returned: a <GVolume>.

the <GVolume> object that is the parent for mount or #f if no wants to adopt the <GMount>.

Procedure: volume-monitor:get ⇒ %return

Gets the volume monitor used by gio.

%return

Returned: a <GVolumeMonitor>.

a reference to the <GVolumeMonitor> used by gio. Call object:unref when done with it, after disconnecting any signal handlers.

Method: volume-monitor:get-connected-drives self ⇒ %return
Method: get-connected-drives self ⇒ %return

Gets a list of drives connected to the system.

The returned list should be freed with g_list_free(), after its elements have been unreffed with object:unref.

self

Passed: a <GVolumeMonitor>.

a <GVolumeMonitor>.

%return

Returned: a list, each a <GDrive>.

a GList of connected <GDrive> objects.

Method: volume-monitor:get-mount-for-uuid self uuid ⇒ %return
Method: get-mount-for-uuid self uuid ⇒ %return

Finds a <GMount> object by its UUID (see mount:get-uuid)

self

Passed: a <GVolumeMonitor>.

a <GVolumeMonitor>.

uuid

Passed: a string.

the UUID to look for

%return

Returned: a <GMount>, or #f.

a <GMount> or #f if no such mount is available. Free the returned object with object:unref.

Method: volume-monitor:get-mounts self ⇒ %return
Method: get-mounts self ⇒ %return

Gets a list of the mounts on the system.

The returned list should be freed with g_list_free(), after its elements have been unreffed with object:unref.

self

Passed: a <GVolumeMonitor>.

a <GVolumeMonitor>.

%return

Returned: a list, each a <GMount>.

a GList of <GMount> objects.

Method: volume-monitor:get-volume-for-uuid self uuid ⇒ %return
Method: get-volume-for-uuid self uuid ⇒ %return

Finds a <GVolume> object by its UUID (see volume:get-uuid)

self

Passed: a <GVolumeMonitor>.

a <GVolumeMonitor>.

uuid

Passed: a string.

the UUID to look for

%return

Returned: a <GVolume>, or #f.

a <GVolume> or #f if no such volume is available. Free the returned object with object:unref.

Method: volume-monitor:get-volumes self ⇒ %return
Method: get-volumes self ⇒ %return

Gets a list of the volumes on the system.

The returned list should be freed with g_list_free(), after its elements have been unreffed with object:unref.

self

Passed: a <GVolumeMonitor>.

a <GVolumeMonitor>.

%return

Returned: a list, each a <GVolume>.

a GList of <GVolume> objects.

Signals

Signal: volume-monitor:drive-changed

Connect a handler with (connect object volume-monitor:drive-changed handler). It is called as (handler self drive).

Emitted when a drive changes.

self

Passed: a <GVolumeMonitor>.

drive

Passed: a <GDrive>.

the drive that changed

Signal: volume-monitor:drive-connected

Connect a handler with (connect object volume-monitor:drive-connected handler). It is called as (handler self drive).

Emitted when a drive is connected to the system.

self

Passed: a <GVolumeMonitor>.

drive

Passed: a <GDrive>.

a <GDrive> that was connected.

Signal: volume-monitor:drive-disconnected

Connect a handler with (connect object volume-monitor:drive-disconnected handler). It is called as (handler self drive).

Emitted when a drive is disconnected from the system.

self

Passed: a <GVolumeMonitor>.

drive

Passed: a <GDrive>.

a <GDrive> that was disconnected.

Signal: volume-monitor:drive-eject-button

Connect a handler with (connect object volume-monitor:drive-eject-button handler). It is called as (handler self drive).

Emitted when the eject button is pressed on drive.

self

Passed: a <GVolumeMonitor>.

drive

Passed: a <GDrive>.

the drive where the eject button was pressed

Signal: volume-monitor:drive-stop-button

Connect a handler with (connect object volume-monitor:drive-stop-button handler). It is called as (handler self drive).

Emitted when the stop button is pressed on drive.

self

Passed: a <GVolumeMonitor>.

drive

Passed: a <GDrive>.

the drive where the stop button was pressed

Signal: volume-monitor:mount-added

Connect a handler with (connect object volume-monitor:mount-added handler). It is called as (handler self mount).

Emitted when a mount is added.

self

Passed: a <GVolumeMonitor>.

mount

Passed: a <GMount>.

a <GMount> that was added.

Signal: volume-monitor:mount-changed

Connect a handler with (connect object volume-monitor:mount-changed handler). It is called as (handler self mount).

Emitted when a mount changes.

self

Passed: a <GVolumeMonitor>.

mount

Passed: a <GMount>.

a <GMount> that changed.

Signal: volume-monitor:mount-pre-unmount

Connect a handler with (connect object volume-monitor:mount-pre-unmount handler). It is called as (handler self mount).

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

This signal depends on the backend and is only emitted if GIO was used to unmount.

self

Passed: a <GVolumeMonitor>.

mount

Passed: a <GMount>.

a <GMount> that is being unmounted.

Signal: volume-monitor:mount-removed

Connect a handler with (connect object volume-monitor:mount-removed handler). It is called as (handler self mount).

Emitted when a mount is removed.

self

Passed: a <GVolumeMonitor>.

mount

Passed: a <GMount>.

a <GMount> that was removed.

Signal: volume-monitor:volume-added

Connect a handler with (connect object volume-monitor:volume-added handler). It is called as (handler self volume).

Emitted when a mountable volume is added to the system.

self

Passed: a <GVolumeMonitor>.

volume

Passed: a <GVolume>.

a <GVolume> that was added.

Signal: volume-monitor:volume-changed

Connect a handler with (connect object volume-monitor:volume-changed handler). It is called as (handler self volume).

Emitted when mountable volume is changed.

self

Passed: a <GVolumeMonitor>.

volume

Passed: a <GVolume>.

a <GVolume> that changed.

Signal: volume-monitor:volume-removed

Connect a handler with (connect object volume-monitor:volume-removed handler). It is called as (handler self volume).

Emitted when a mountable volume is removed from the system.

self

Passed: a <GVolumeMonitor>.

volume

Passed: a <GVolume>.

a <GVolume> that was removed.

Virtual methods

Virtual method: volume-monitor:do-drive-changed implementor self drive

To override it in a new class, give register-type #:vfuncs `((drive-changed . ,procedure)). The procedure is called as (procedure self drive).

implementor

Passed: the class whose implementation to call: <GVolumeMonitor>, or a class that derives from it, or its GType number.

self

Passed: a <GVolumeMonitor>.

drive

Passed: a <GDrive>.

Virtual method: volume-monitor:do-drive-connected implementor self drive

To override it in a new class, give register-type #:vfuncs `((drive-connected . ,procedure)). The procedure is called as (procedure self drive).

implementor

Passed: the class whose implementation to call: <GVolumeMonitor>, or a class that derives from it, or its GType number.

self

Passed: a <GVolumeMonitor>.

drive

Passed: a <GDrive>.

Virtual method: volume-monitor:do-drive-disconnected implementor self drive

To override it in a new class, give register-type #:vfuncs `((drive-disconnected . ,procedure)). The procedure is called as (procedure self drive).

implementor

Passed: the class whose implementation to call: <GVolumeMonitor>, or a class that derives from it, or its GType number.

self

Passed: a <GVolumeMonitor>.

drive

Passed: a <GDrive>.

Virtual method: volume-monitor:do-drive-eject-button implementor self drive

To override it in a new class, give register-type #:vfuncs `((drive-eject-button . ,procedure)). The procedure is called as (procedure self drive).

implementor

Passed: the class whose implementation to call: <GVolumeMonitor>, or a class that derives from it, or its GType number.

self

Passed: a <GVolumeMonitor>.

drive

Passed: a <GDrive>.

Virtual method: volume-monitor:do-drive-stop-button implementor self drive

To override it in a new class, give register-type #:vfuncs `((drive-stop-button . ,procedure)). The procedure is called as (procedure self drive).

implementor

Passed: the class whose implementation to call: <GVolumeMonitor>, or a class that derives from it, or its GType number.

self

Passed: a <GVolumeMonitor>.

drive

Passed: a <GDrive>.

Virtual method: volume-monitor:do-get-connected-drives implementor self ⇒ %return

Gets a list of drives connected to the system.

The returned list should be freed with g_list_free(), after its elements have been unreffed with object:unref.

To override it in a new class, give register-type #:vfuncs `((get-connected-drives . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: <GVolumeMonitor>, or a class that derives from it, or its GType number.

self

Passed: a <GVolumeMonitor>.

a <GVolumeMonitor>.

%return

Returned: a list, each a <GDrive>.

a GList of connected <GDrive> objects.

Virtual method: volume-monitor:do-get-mount-for-uuid implementor self uuid ⇒ %return

Finds a <GMount> object by its UUID (see mount:get-uuid)

To override it in a new class, give register-type #:vfuncs `((get-mount-for-uuid . ,procedure)). The procedure is called as (procedure self uuid) ⇒ %return.

implementor

Passed: the class whose implementation to call: <GVolumeMonitor>, or a class that derives from it, or its GType number.

self

Passed: a <GVolumeMonitor>.

a <GVolumeMonitor>.

uuid

Passed: a string.

the UUID to look for

%return

Returned: a <GMount>, or #f.

a <GMount> or #f if no such mount is available. Free the returned object with object:unref.

Virtual method: volume-monitor:do-get-mounts implementor self ⇒ %return

Gets a list of the mounts on the system.

The returned list should be freed with g_list_free(), after its elements have been unreffed with object:unref.

To override it in a new class, give register-type #:vfuncs `((get-mounts . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: <GVolumeMonitor>, or a class that derives from it, or its GType number.

self

Passed: a <GVolumeMonitor>.

a <GVolumeMonitor>.

%return

Returned: a list, each a <GMount>.

a GList of <GMount> objects.

Virtual method: volume-monitor:do-get-volume-for-uuid implementor self uuid ⇒ %return

Finds a <GVolume> object by its UUID (see volume:get-uuid)

To override it in a new class, give register-type #:vfuncs `((get-volume-for-uuid . ,procedure)). The procedure is called as (procedure self uuid) ⇒ %return.

implementor

Passed: the class whose implementation to call: <GVolumeMonitor>, or a class that derives from it, or its GType number.

self

Passed: a <GVolumeMonitor>.

a <GVolumeMonitor>.

uuid

Passed: a string.

the UUID to look for

%return

Returned: a <GVolume>, or #f.

a <GVolume> or #f if no such volume is available. Free the returned object with object:unref.

Virtual method: volume-monitor:do-get-volumes implementor self ⇒ %return

Gets a list of the volumes on the system.

The returned list should be freed with g_list_free(), after its elements have been unreffed with object:unref.

To override it in a new class, give register-type #:vfuncs `((get-volumes . ,procedure)). The procedure is called as (procedure self) ⇒ %return.

implementor

Passed: the class whose implementation to call: <GVolumeMonitor>, or a class that derives from it, or its GType number.

self

Passed: a <GVolumeMonitor>.

a <GVolumeMonitor>.

%return

Returned: a list, each a <GVolume>.

a GList of <GVolume> objects.

Virtual method: volume-monitor:do-mount-added implementor self mount

To override it in a new class, give register-type #:vfuncs `((mount-added . ,procedure)). The procedure is called as (procedure self mount).

implementor

Passed: the class whose implementation to call: <GVolumeMonitor>, or a class that derives from it, or its GType number.

self

Passed: a <GVolumeMonitor>.

mount

Passed: a <GMount>.

Virtual method: volume-monitor:do-mount-changed implementor self mount

To override it in a new class, give register-type #:vfuncs `((mount-changed . ,procedure)). The procedure is called as (procedure self mount).

implementor

Passed: the class whose implementation to call: <GVolumeMonitor>, or a class that derives from it, or its GType number.

self

Passed: a <GVolumeMonitor>.

mount

Passed: a <GMount>.

Virtual method: volume-monitor:do-mount-pre-unmount implementor self mount

To override it in a new class, give register-type #:vfuncs `((mount-pre-unmount . ,procedure)). The procedure is called as (procedure self mount).

implementor

Passed: the class whose implementation to call: <GVolumeMonitor>, or a class that derives from it, or its GType number.

self

Passed: a <GVolumeMonitor>.

mount

Passed: a <GMount>.

Virtual method: volume-monitor:do-mount-removed implementor self mount

To override it in a new class, give register-type #:vfuncs `((mount-removed . ,procedure)). The procedure is called as (procedure self mount).

implementor

Passed: the class whose implementation to call: <GVolumeMonitor>, or a class that derives from it, or its GType number.

self

Passed: a <GVolumeMonitor>.

mount

Passed: a <GMount>.

Virtual method: volume-monitor:do-volume-added implementor self volume

To override it in a new class, give register-type #:vfuncs `((volume-added . ,procedure)). The procedure is called as (procedure self volume).

implementor

Passed: the class whose implementation to call: <GVolumeMonitor>, or a class that derives from it, or its GType number.

self

Passed: a <GVolumeMonitor>.

volume

Passed: a <GVolume>.

Virtual method: volume-monitor:do-volume-changed implementor self volume

To override it in a new class, give register-type #:vfuncs `((volume-changed . ,procedure)). The procedure is called as (procedure self volume).

implementor

Passed: the class whose implementation to call: <GVolumeMonitor>, or a class that derives from it, or its GType number.

self

Passed: a <GVolumeMonitor>.

volume

Passed: a <GVolume>.

Virtual method: volume-monitor:do-volume-removed implementor self volume

To override it in a new class, give register-type #:vfuncs `((volume-removed . ,procedure)). The procedure is called as (procedure self volume).

implementor

Passed: the class whose implementation to call: <GVolumeMonitor>, or a class that derives from it, or its GType number.

self

Passed: a <GVolumeMonitor>.

volume

Passed: a <GVolume>.