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.
parent-instanceThis 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.
Gets the volume monitor used by gio.
Returned: a <GVolumeMonitor>.
a reference to the <GVolumeMonitor> used by
gio. Call object:unref when done
with it, after disconnecting any signal handlers.
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.
Passed: a <GVolumeMonitor>.
Returned: a list, each a <GDrive>.
a GList of connected <GDrive> objects.
Finds a <GMount> object by its UUID (see
mount:get-uuid)
Passed: a <GVolumeMonitor>.
Passed: a string.
the UUID to look for
Returned: a <GMount>, or #f.
a <GMount> or #f if no such mount is
available. Free the returned object with object:unref.
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.
Passed: a <GVolumeMonitor>.
Returned: a list, each a <GMount>.
a GList of <GMount> objects.
Finds a <GVolume> object by its UUID (see
volume:get-uuid)
Passed: a <GVolumeMonitor>.
Passed: a string.
the UUID to look for
Returned: a <GVolume>, or #f.
a <GVolume> or #f if no such volume is
available. Free the returned object with object:unref.
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.
Passed: a <GVolumeMonitor>.
Returned: a list, each a <GVolume>.
a GList of <GVolume> objects.
Connect a handler with (connect object
volume-monitor:drive-changed handler). It is called as (handler
self drive).
Emitted when a drive changes.
Passed: a <GVolumeMonitor>.
Passed: a <GDrive>.
the drive that changed
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.
Passed: a <GVolumeMonitor>.
Passed: a <GDrive>.
a <GDrive> that was connected.
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.
Passed: a <GVolumeMonitor>.
Passed: a <GDrive>.
a <GDrive> that was disconnected.
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.
Passed: a <GVolumeMonitor>.
Passed: a <GDrive>.
the drive where the eject button was pressed
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.
Passed: a <GVolumeMonitor>.
Passed: a <GDrive>.
the drive where the stop button was pressed
Connect a handler with (connect object volume-monitor:mount-added
handler). It is called as (handler self mount).
Emitted when a mount is added.
Passed: a <GVolumeMonitor>.
Passed: a <GMount>.
a <GMount> that was added.
Connect a handler with (connect object
volume-monitor:mount-changed handler). It is called as (handler
self mount).
Emitted when a mount changes.
Passed: a <GVolumeMonitor>.
Passed: a <GMount>.
a <GMount> that changed.
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.
Passed: a <GVolumeMonitor>.
Passed: a <GMount>.
a <GMount> that is being unmounted.
Connect a handler with (connect object
volume-monitor:mount-removed handler). It is called as (handler
self mount).
Emitted when a mount is removed.
Passed: a <GVolumeMonitor>.
Passed: a <GMount>.
a <GMount> that was removed.
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.
Passed: a <GVolumeMonitor>.
Passed: a <GVolume>.
a <GVolume> that was added.
Connect a handler with (connect object
volume-monitor:volume-changed handler). It is called as (handler
self volume).
Emitted when mountable volume is changed.
Passed: a <GVolumeMonitor>.
Passed: a <GVolume>.
a <GVolume> that changed.
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.
Passed: a <GVolumeMonitor>.
Passed: a <GVolume>.
a <GVolume> that was removed.
To override it in a new class, give register-type #:vfuncs
`((drive-changed . ,procedure)). The procedure is called as
(procedure self drive).
Passed: the class whose implementation to call:
<GVolumeMonitor>, or a class that derives
from it, or its GType number.
Passed: a <GVolumeMonitor>.
Passed: a <GDrive>.
To override it in a new class, give register-type #:vfuncs
`((drive-connected . ,procedure)). The procedure is called as
(procedure self drive).
Passed: the class whose implementation to call:
<GVolumeMonitor>, or a class that derives
from it, or its GType number.
Passed: a <GVolumeMonitor>.
Passed: a <GDrive>.
To override it in a new class, give register-type #:vfuncs
`((drive-disconnected . ,procedure)). The procedure is called as
(procedure self drive).
Passed: the class whose implementation to call:
<GVolumeMonitor>, or a class that derives
from it, or its GType number.
Passed: a <GVolumeMonitor>.
Passed: a <GDrive>.
To override it in a new class, give register-type #:vfuncs
`((drive-eject-button . ,procedure)). The procedure is called as
(procedure self drive).
Passed: the class whose implementation to call:
<GVolumeMonitor>, or a class that derives
from it, or its GType number.
Passed: a <GVolumeMonitor>.
Passed: a <GDrive>.
To override it in a new class, give register-type #:vfuncs
`((drive-stop-button . ,procedure)). The procedure is called as
(procedure self drive).
Passed: the class whose implementation to call:
<GVolumeMonitor>, or a class that derives
from it, or its GType number.
Passed: a <GVolumeMonitor>.
Passed: a <GDrive>.
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.
Passed: the class whose implementation to call:
<GVolumeMonitor>, or a class that derives
from it, or its GType number.
Passed: a <GVolumeMonitor>.
Returned: a list, each a <GDrive>.
a GList of connected <GDrive> objects.
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.
Passed: the class whose implementation to call:
<GVolumeMonitor>, or a class that derives
from it, or its GType number.
Passed: a <GVolumeMonitor>.
Passed: a string.
the UUID to look for
Returned: a <GMount>, or #f.
a <GMount> or #f if no such mount is
available. Free the returned object with object:unref.
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.
Passed: the class whose implementation to call:
<GVolumeMonitor>, or a class that derives
from it, or its GType number.
Passed: a <GVolumeMonitor>.
Returned: a list, each a <GMount>.
a GList of <GMount> objects.
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.
Passed: the class whose implementation to call:
<GVolumeMonitor>, or a class that derives
from it, or its GType number.
Passed: a <GVolumeMonitor>.
Passed: a string.
the UUID to look for
Returned: a <GVolume>, or #f.
a <GVolume> or #f if no such volume is
available. Free the returned object with object:unref.
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.
Passed: the class whose implementation to call:
<GVolumeMonitor>, or a class that derives
from it, or its GType number.
Passed: a <GVolumeMonitor>.
Returned: a list, each a <GVolume>.
a GList of <GVolume> objects.
To override it in a new class, give register-type #:vfuncs
`((mount-added . ,procedure)). The procedure is called as
(procedure self mount).
Passed: the class whose implementation to call:
<GVolumeMonitor>, or a class that derives
from it, or its GType number.
Passed: a <GVolumeMonitor>.
Passed: a <GMount>.
To override it in a new class, give register-type #:vfuncs
`((mount-changed . ,procedure)). The procedure is called as
(procedure self mount).
Passed: the class whose implementation to call:
<GVolumeMonitor>, or a class that derives
from it, or its GType number.
Passed: a <GVolumeMonitor>.
Passed: a <GMount>.
To override it in a new class, give register-type #:vfuncs
`((mount-pre-unmount . ,procedure)). The procedure is called as
(procedure self mount).
Passed: the class whose implementation to call:
<GVolumeMonitor>, or a class that derives
from it, or its GType number.
Passed: a <GVolumeMonitor>.
Passed: a <GMount>.
To override it in a new class, give register-type #:vfuncs
`((mount-removed . ,procedure)). The procedure is called as
(procedure self mount).
Passed: the class whose implementation to call:
<GVolumeMonitor>, or a class that derives
from it, or its GType number.
Passed: a <GVolumeMonitor>.
Passed: a <GMount>.
To override it in a new class, give register-type #:vfuncs
`((volume-added . ,procedure)). The procedure is called as
(procedure self volume).
Passed: the class whose implementation to call:
<GVolumeMonitor>, or a class that derives
from it, or its GType number.
Passed: a <GVolumeMonitor>.
Passed: a <GVolume>.
To override it in a new class, give register-type #:vfuncs
`((volume-changed . ,procedure)). The procedure is called as
(procedure self volume).
Passed: the class whose implementation to call:
<GVolumeMonitor>, or a class that derives
from it, or its GType number.
Passed: a <GVolumeMonitor>.
Passed: a <GVolume>.
To override it in a new class, give register-type #:vfuncs
`((volume-removed . ,procedure)). The procedure is called as
(procedure self volume).
Passed: the class whose implementation to call:
<GVolumeMonitor>, or a class that derives
from it, or its GType number.
Passed: a <GVolumeMonitor>.
Passed: a <GVolume>.