glibmm: Gio::Mount Class Reference

glibmm 2.59.1

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gio::Mount Class Reference
Stream Classes

The Mount interface represents user-visible mounts. More...

`#include <giomm/mount.h>`

Inheritance diagram for Gio::Mount:
[legend]

## Public Types
enum | UnmountFlags { UnmountFlags::NONE = 0x0, UnmountFlags::FORCE = (1 << 0) }
| Flags used when an unmounting a mount. More...
enum | MountFlags { MountFlags::NONE = 0x0 }
| Flags used when mounting a mount. More...
Public Types inherited from sigc::trackable
typedef internal::func_destroy_notify | func_destroy_notify
Public Types inherited from sigc::notifiable
typedef internal::func_destroy_notify | func_destroy_notify

## Public Member Functions
| Mount (Mount&& src) noexcept
Mount& | operator= (Mount&& src) noexcept
| ~Mount () noexcept override
GMount* | gobj ()
| Provides access to the underlying C GObject. More...
const GMount* | gobj () const
| Provides access to the underlying C GObject. More...
Glib::RefPtr< File > | get_root ()
| Gets the root directory on mount. More...
Glib::RefPtr< const File > | get_root () const
| Gets the root directory on mount. More...
std::string | get_name () const
| Gets the name of mount. More...
Glib::RefPtr< Icon > | get_icon ()
| Gets the icon for mount. More...
Glib::RefPtr< const Icon > | get_icon () const
| Gets the icon for mount. More...
Glib::RefPtr< Icon > | get_symbolic_icon ()
| Gets the symbolic icon for mount. More...
Glib::RefPtr< const Icon > | get_symbolic_icon () const
| Gets the symbolic icon for mount. More...
std::string | get_uuid () const
| Gets the UUID for the mount. More...
Glib::RefPtr< Volume > | get_volume ()
| Gets the volume for the mount. More...
Glib::RefPtr< const Volume > | get_volume () const
| Gets the volume for the mount. More...
Glib::RefPtr< Drive > | get_drive ()
| Gets the drive for the mount. More...
Glib::RefPtr< const Drive > | get_drive () const
| Gets the drive for the mount. More...
bool | can_unmount () const
| Checks if mount can be unmounted. More...
bool | can_eject () const
| Checks if mount can be ejected. More...
void | unmount (const SlotAsyncReady& slot, const Glib::RefPtr< Cancellable >& cancellable, UnmountFlags flags=UnmountFlags::NONE)
void | unmount (const SlotAsyncReady& slot, UnmountFlags flags=UnmountFlags::NONE)
void | unmount (UnmountFlags flags=UnmountFlags::NONE)
void | unmount (const Glib::RefPtr< MountOperation >& mount_operation, UnmountFlags flags=UnmountFlags::NONE)
void | unmount (const Glib::RefPtr< MountOperation >& mount_operation, const SlotAsyncReady& slot, UnmountFlags flags=UnmountFlags::NONE)
void | unmount (const Glib::RefPtr< MountOperation >& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr< Cancellable >& cancellable, UnmountFlags flags=UnmountFlags::NONE)
bool | unmount_finish (const Glib::RefPtr< AsyncResult >& result)
| Finishes unmounting a mount. More...
void | remount (const Glib::RefPtr< MountOperation >& operation, const SlotAsyncReady& slot, const Glib::RefPtr< Cancellable >& cancellable, MountFlags flags=MountFlags::NONE)
| Remounts a mount. More...
void | remount (const Glib::RefPtr< MountOperation >& operation, const SlotAsyncReady& slot, MountFlags flags=MountFlags::NONE)
| Remounts a mount. More...
void | remount (const Glib::RefPtr< MountOperation >& operation, MountFlags flags=MountFlags::NONE)
| Remounts a mount. More...
void | remount (MountFlags flags=MountFlags::NONE)
| Remounts a mount, without user interaction. More...
bool | remount_finish (const Glib::RefPtr< AsyncResult >& result)
| Finishes remounting a mount. More...
void | eject (const SlotAsyncReady& slot, const Glib::RefPtr< Cancellable >& cancellable, UnmountFlags flags=UnmountFlags::NONE)
void | eject (const SlotAsyncReady& slot, UnmountFlags flags=UnmountFlags::NONE)
void | eject (UnmountFlags flags=UnmountFlags::NONE)
void | eject (const Glib::RefPtr< MountOperation >& mount_operation, const SlotAsyncReady& slot, const Glib::RefPtr< Cancellable >& cancellable, UnmountFlags flags=UnmountFlags::NONE)
void | eject (const Glib::RefPtr< MountOperation >& mount_operation, const SlotAsyncReady& slot, UnmountFlags flags=UnmountFlags::NONE)
void | eject (const Glib::RefPtr< MountOperation >& mount_operation, UnmountFlags flags=UnmountFlags::NONE)
bool | eject_finish (const Glib::RefPtr< AsyncResult >& result)
| Finishes ejecting a mount. More...
void | guess_content_type (const SlotAsyncReady& slot, const Glib::RefPtr< Cancellable >& cancellable, bool force_rescan=true)
| Tries to guess the type of content stored on the mount. More...
void | guess_content_type (const SlotAsyncReady& slot, bool force_rescan=true)
| Tries to guess the type of content stored on the mount. More...
void | guess_content_type (bool force_rescan=true)
| Tries to guess the type of content stored on the mount. More...
void | guess_content_type_sync (const Glib::RefPtr< Cancellable >& cancellable, bool force_rescan=true)
void | guess_content_type_sync (bool force_rescan=true)
std::vector< Glib::ustring > | guess_content_type_finish (const Glib::RefPtr< AsyncResult >& result)
| Finishes guessing content types of the Mount. More...
bool | is_shadowed () const
| Determines if mount is shadowed. More...
void | shadow ()
| Increments the shadow count on mount. More...
void | unshadow ()
| Decrements the shadow count on mount. More...
Glib::RefPtr< File > | get_default_location () const
| Gets the default location of mount. More...
Glib::ustring | get_sort_key () const
| Gets the sort key for mount, if any. More...
Glib::SignalProxy< void()> | signal_changed ()
Glib::SignalProxy< void()> | signal_unmounted ()
Glib::SignalProxy< void()> | signal_pre_unmount ()
Public Member Functions inherited from Glib::Interface
| Interface ()
| A Default constructor. More...
| Interface (Interface&& src) noexcept
Interface& | operator= (Interface&& src) noexcept
| Interface (const Glib::Interface_Class& interface_class)
| Called by constructors of derived classes. More...
| Interface (GObject* castitem)
| Called by constructors of derived classes. More...
| ~Interface () noexcept override
| Interface (const Interface&)=delete
Interface& | operator= (const Interface&)=delete
GObject* | gobj ()
const GObject* | gobj () const
Public Member Functions inherited from Glib::ObjectBase
| ObjectBase (const ObjectBase&)=delete
ObjectBase& | operator= (const ObjectBase&)=delete
void | set_property_value (const Glib::ustring& property_name, const Glib::ValueBase& value)
| You probably want to use a specific property_*() accessor method instead. More...
void | get_property_value (const Glib::ustring& property_name, Glib::ValueBase& value) const
| You probably want to use a specific property_*() accessor method instead. More...
template<class PropertyType >
void | set_property (const Glib::ustring& property_name, const PropertyType& value)
| You probably want to use a specific property_*() accessor method instead. More...
template<class PropertyType >
void | get_property (const Glib::ustring& property_name, PropertyType& value) const
| You probably want to use a specific property_*() accessor method instead. More...
template<class PropertyType >
PropertyType | get_property (const Glib::ustring& property_name) const
| You probably want to use a specific property_*() accessor method instead. More...
sigc::connection | connect_property_changed (const Glib::ustring& property_name, const sigc::slot< void()>& slot)
| You can use the signal_changed() signal of the property proxy instead. More...
sigc::connection | connect_property_changed (const Glib::ustring& property_name, sigc::slot< void()>&& slot)
| You can use the signal_changed() signal of the property proxy instead. More...
void | freeze_notify ()
| Increases the freeze count on object. More...
void | thaw_notify ()
| Reverts the effect of a previous call to freeze_notify(). More...
virtual void | reference () const
| Increment the reference count for this object. More...
virtual void | unreference () const
| Decrement the reference count for this object. More...
GObject* | gobj ()
| Provides access to the underlying C GObject. More...
const GObject* | gobj () const
| Provides access to the underlying C GObject. More...
GObject* | gobj_copy () const
| Give a ref-ed copy to someone. Use for direct struct access. More...
Public Member Functions inherited from sigc::trackable
| trackable () noexcept
| trackable (const trackable &src) noexcept
| trackable (trackable &&src) noexcept
| ~trackable ()
void | add_destroy_notify_callback (notifiable *data, func_destroy_notify func) const
void | notify_callbacks ()
trackable & | operator= (const trackable &src)
trackable & | operator= (trackable &&src) noexcept
void | remove_destroy_notify_callback (notifiable *data) const

## Static Public Member Functions
static void | add_interface (GType gtype_implementer)
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...

## Protected Member Functions
| Mount ()
| You should derive from this class to use it. More...
virtual void | on_changed ()
| This is a default handler for the signal signal_changed(). More...
virtual void | on_unmounted ()
| This is a default handler for the signal signal_unmounted(). More...
virtual void | on_pre_unmount ()
| This is a default handler for the signal signal_pre_unmount(). More...
Protected Member Functions inherited from Glib::ObjectBase
| ObjectBase ()
| This default constructor is called implicitly from the constructor of user-derived classes, even if, for instance, Gtk::Button calls a different ObjectBase constructor. More...
| ObjectBase (const char* custom_type_name)
| A derived constructor always overrides this choice. More...
| ObjectBase (const std::type_info& custom_type_info)
| This constructor is a special feature to allow creation of derived types on the fly, without having to use g_object_new() manually. More...
| ObjectBase (ObjectBase&& src) noexcept
ObjectBase& | operator= (ObjectBase&& src) noexcept
virtual | ~ObjectBase () noexcept=0
void | initialize (GObject* castitem)
void | initialize_move (GObject* castitem, Glib::ObjectBase* previous_wrapper)

## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Gio::Mount > | wrap (GMount* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Detailed Description

The Mount interface represents user-visible mounts.

Mount is a "mounted" filesystem that you can access. Mounted is in quotes because it's not the same as a unix mount: it might be a gvfs mount, but you can still access the files on it if you use GIO. It might or might not be related to a volume object.

Unmounting a Mount instance is an asynchronous operation. For more information about asynchronous operations, see AsyncReady. To unmount a Mount instance, first call unmount(). The callback slot will be called when the operation has resolved (either with success or failure), and a AsyncReady structure will be passed to the callback. That callback should then call unmount_finish() with the AsyncReady data to see if the operation was completed successfully.

Since glibmm 2.16:

## Constructor & Destructor Documentation

## ◆ Mount() [1/2]

Gio::Mount::Mount | ( |  | ) |
| protected

You should derive from this class to use it.

## ◆ Mount() [2/2]

Gio::Mount::Mount | ( | Mount&& | src | ) |
| noexcept

## ◆ ~Mount()

Gio::Mount::~Mount | ( |  | ) |
| overridenoexcept

## Member Function Documentation

## ◆ add_interface()

static void Gio::Mount::add_interface | ( | GType | gtype_implementer | ) |
| static

## ◆ can_eject()

bool Gio::Mount::can_eject | ( |  | ) | const

Checks if mount can be ejected.

Returns
  `true` if the mount can be ejected.

## ◆ can_unmount()

bool Gio::Mount::can_unmount | ( |  | ) | const

Checks if mount can be unmounted.

Returns
  `true` if the mount can be unmounted.

## ◆ eject() [1/6]

void Gio::Mount::eject | ( | const SlotAsyncReady& | slot,
|  | const Glib::RefPtr< Cancellable >& | cancellable,
|  | UnmountFlags | flags = `UnmountFlags::NONE`
| ) |  |

## ◆ eject() [2/6]

void Gio::Mount::eject | ( | const SlotAsyncReady& | slot,
|  | UnmountFlags | flags = `UnmountFlags::NONE`
| ) |  |

## ◆ eject() [3/6]

void Gio::Mount::eject | ( | UnmountFlags | flags = `UnmountFlags::NONE` | ) |

## ◆ eject() [4/6]

void Gio::Mount::eject | ( | const Glib::RefPtr< MountOperation >& | mount_operation,
|  | const SlotAsyncReady& | slot,
|  | const Glib::RefPtr< Cancellable >& | cancellable,
|  | UnmountFlags | flags = `UnmountFlags::NONE`
| ) |  |

## ◆ eject() [5/6]

void Gio::Mount::eject | ( | const Glib::RefPtr< MountOperation >& | mount_operation,
|  | const SlotAsyncReady& | slot,
|  | UnmountFlags | flags = `UnmountFlags::NONE`
| ) |  |

## ◆ eject() [6/6]

void Gio::Mount::eject | ( | const Glib::RefPtr< MountOperation >& | mount_operation,
|  | UnmountFlags | flags = `UnmountFlags::NONE`
| ) |  |

## ◆ eject_finish()

bool Gio::Mount::eject_finish | ( | const Glib::RefPtr< AsyncResult >& | result | ) |

Finishes ejecting a mount.

If any errors occurred during the operation, error will be set to contain the errors and `false` will be returned.

Since glibmm 2.22:

Parameters

  result | A AsyncResult.

Returns
  `true` if the mount was successfully ejected. `false` otherwise.

Exceptions

  Glib::Error |

## ◆ get_default_location()

Glib::RefPtr<File> Gio::Mount::get_default_location | ( |  | ) | const

Gets the default location of mount.

The default location of the given mount is a path that reflects the main entry point for the user (e.g. the home directory, or the root of the volume).

Returns
  A File. The returned object should be unreffed with Glib::object_unref() when no longer needed.

## ◆ get_drive() [1/2]

Glib::RefPtr<Drive> Gio::Mount::get_drive | ( |  | ) |

Gets the drive for the mount.

This is a convenience method for getting the Volume and then using that object to get the Drive.

Returns
  A Drive or `nullptr` if mount is not associated with a volume or a drive. The returned object should be unreffed with Glib::object_unref() when no longer needed.

## ◆ get_drive() [2/2]

Glib::RefPtr<const Drive> Gio::Mount::get_drive | ( |  | ) | const

Gets the drive for the mount.

This is a convenience method for getting the Volume and then using that object to get the Drive.

Returns
  A Drive or `nullptr` if mount is not associated with a volume or a drive. The returned object should be unreffed with Glib::object_unref() when no longer needed.

## ◆ get_icon() [1/2]

Glib::RefPtr<Icon> Gio::Mount::get_icon | ( |  | ) |

Gets the icon for mount.

Returns
  A Icon. The returned object should be unreffed with Glib::object_unref() when no longer needed.

## ◆ get_icon() [2/2]

Glib::RefPtr<const Icon> Gio::Mount::get_icon | ( |  | ) | const

Gets the icon for mount.

Returns
  A Icon. The returned object should be unreffed with Glib::object_unref() when no longer needed.

## ◆ get_name()

std::string Gio::Mount::get_name | ( |  | ) | const

Gets the name of mount.

Returns
  The name for the given mount.

## ◆ get_root() [1/2]

Glib::RefPtr<File> Gio::Mount::get_root | ( |  | ) |

Gets the root directory on mount.

Returns
  A File. The returned object should be unreffed with Glib::object_unref() when no longer needed.

## ◆ get_root() [2/2]

Glib::RefPtr<const File> Gio::Mount::get_root | ( |  | ) | const

Gets the root directory on mount.

Returns
  A File. The returned object should be unreffed with Glib::object_unref() when no longer needed.

## ◆ get_sort_key()

Glib::ustring Gio::Mount::get_sort_key | ( |  | ) | const

Gets the sort key for mount, if any.

Since glibmm 2.32:

Returns
  Sorting key for mount or `nullptr` if no such key is available.

## ◆ get_symbolic_icon() [1/2]

Glib::RefPtr<Icon> Gio::Mount::get_symbolic_icon | ( |  | ) |

Gets the symbolic icon for mount.

Since glibmm 2.34:

Returns
  A Icon. The returned object should be unreffed with Glib::object_unref() when no longer needed.

## ◆ get_symbolic_icon() [2/2]

Glib::RefPtr<const Icon> Gio::Mount::get_symbolic_icon | ( |  | ) | const

Gets the symbolic icon for mount.

Since glibmm 2.34:

Returns
  A Icon. The returned object should be unreffed with Glib::object_unref() when no longer needed.

## ◆ get_type()

static GType Gio::Mount::get_type | ( |  | ) |
| static

Get the GType for this class, for use with the underlying GObject type system.

## ◆ get_uuid()

std::string Gio::Mount::get_uuid | ( |  | ) | const

Gets the UUID for the mount.

The reference is typically based on the file system UUID for the mount in question and should be considered an opaque string. Returns `nullptr` if there is no UUID available.

Returns
  The UUID for mount or `nullptr` if no UUID can be computed.

## ◆ get_volume() [1/2]

Glib::RefPtr<Volume> Gio::Mount::get_volume | ( |  | ) |

Gets the volume for the mount.

Returns
  A Volume or `nullptr` if mount is not associated with a volume. The returned object should be unreffed with Glib::object_unref() when no longer needed.

## ◆ get_volume() [2/2]

Glib::RefPtr<const Volume> Gio::Mount::get_volume | ( |  | ) | const

Gets the volume for the mount.

Returns
  A Volume or `nullptr` if mount is not associated with a volume. The returned object should be unreffed with Glib::object_unref() when no longer needed.

## ◆ gobj() [1/2]

GMount* Gio::Mount::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## ◆ gobj() [2/2]

const GMount* Gio::Mount::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## ◆ guess_content_type() [1/3]

void Gio::Mount::guess_content_type | ( | const SlotAsyncReady& | slot,
|  | const Glib::RefPtr< Cancellable >& | cancellable,
|  | bool | force_rescan = `true`
| ) |  |

Tries to guess the type of content stored on the mount.

Returns one or more textual identifiers of well-known content types (typically prefixed with "x-content/"), e.g. x-content/image-dcf for camera memory cards. See the shared-mime-info specification for more on x-content types.

This is an asynchronous operation, and is finished by calling guess_content_type_finish().

Parameters

  slot | A callback which will be called when the operation is completed or canceled.
  cancellable | A cancellable object which can be used to cancel the operation.
  force_rescan | Whether to force a rescan of the content. Otherwise a cached result will be used if available.

Since glibmm 2.18:

## ◆ guess_content_type() [2/3]

void Gio::Mount::guess_content_type | ( | const SlotAsyncReady& | slot,
|  | bool | force_rescan = `true`
| ) |  |

Tries to guess the type of content stored on the mount.

Returns one or more textual identifiers of well-known content types (typically prefixed with "x-content/"), e.g. x-content/image-dcf for camera memory cards. See the shared-mime-info specification for more on x-content types.

This is an asynchronous operation, and is finished by calling guess_content_type_finish().

Parameters

  slot | A callback which will be called when the operation is completed or canceled.
  force_rescan | Whether to force a rescan of the content. Otherwise a cached result will be used if available.

Since glibmm 2.18:

## ◆ guess_content_type() [3/3]

void Gio::Mount::guess_content_type | ( | bool | force_rescan = `true` | ) |

Tries to guess the type of content stored on the mount.

Returns one or more textual identifiers of well-known content types (typically prefixed with "x-content/"), e.g. x-content/image-dcf for camera memory cards. See the shared-mime-info specification for more on x-content types.

Parameters

  force_rescan | Whether to force a rescan of the content. Otherwise a cached result will be used if available.

Since glibmm 2.18:

## ◆ guess_content_type_finish()

std::vector<Glib::ustring> Gio::Mount::guess_content_type_finish | ( | const Glib::RefPtr< AsyncResult >& | result | ) |

Finishes guessing content types of the Mount.

If any errors occurred during the operation, an exception will be thrown. In particular, you may get a Gio::Error::NOT_SUPPORTED if the mount does not support content guessing.

Since glibmm 2.18:

Parameters

  result | An AsyncResult.

Returns
  An array of content types.

Exceptions

  Glib::Error |

## ◆ guess_content_type_sync() [1/2]

void Gio::Mount::guess_content_type_sync | ( | const Glib::RefPtr< Cancellable >& | cancellable,
|  | bool | force_rescan = `true`
| ) |  |

## ◆ guess_content_type_sync() [2/2]

void Gio::Mount::guess_content_type_sync | ( | bool | force_rescan = `true` | ) |

## ◆ is_shadowed()

bool Gio::Mount::is_shadowed | ( |  | ) | const

Determines if mount is shadowed.

Applications or libraries should avoid displaying mount in the user interface if it is shadowed.

A mount is said to be shadowed if there exists one or more user visible objects (currently Mount objects) with a root that is inside the root of mount.

One application of shadow mounts is when exposing a single file system that is used to address several logical volumes. In this situation, a VolumeMonitor implementation would create two Volume objects (for example, one for the camera functionality of the device and one for a SD card reader on the device) with activation URIs `gphoto2://[usb:001,002]/store1/` and `gphoto2://[usb:001,002]/store2/`. When the underlying mount (with root `gphoto2://[usb:001,002]/`) is mounted, said VolumeMonitor implementation would create two Mount objects (each with their root matching the corresponding volume activation root) that would shadow the original mount.

The proxy monitor in GVfs 2.26 and later, automatically creates and manage shadow mounts (and shadows the underlying mount) if the activation root on a Volume is set.

Since glibmm 2.20:

Returns
  `true` if mount is shadowed.

## ◆ on_changed()

virtual void Gio::Mount::on_changed | ( |  | ) |
| protectedvirtual

This is a default handler for the signal signal_changed().

## ◆ on_pre_unmount()

virtual void Gio::Mount::on_pre_unmount | ( |  | ) |
| protectedvirtual

This is a default handler for the signal signal_pre_unmount().

## ◆ on_unmounted()

virtual void Gio::Mount::on_unmounted | ( |  | ) |
| protectedvirtual

This is a default handler for the signal signal_unmounted().

## ◆ operator=()

Mount& Gio::Mount::operator= | ( | Mount&& | src | ) |
| noexcept

## ◆ remount() [1/4]

void Gio::Mount::remount | ( | const Glib::RefPtr< MountOperation >& | operation,
|  | const SlotAsyncReady& | slot,
|  | const Glib::RefPtr< Cancellable >& | cancellable,
|  | MountFlags | flags = `MountFlags::NONE`
| ) |  |

Remounts a mount.

This is an asynchronous operation, and is finished by calling mount_finish() with the AsyncResult data returned in the callback slot.

Remounting is useful when some setting affecting the operation of the volume has been changed, as this may need a remount to take affect. While this is semantically equivalent with unmounting and then remounting, not all backends might need to actually be unmounted.

Parameters

  operation | A mount operation.
  slot | A callback which will be called when the operation is completed or canceled.
  cancellable | A cancellable object which can be used to cancel the operation.
  flags | Flags affecting the operation.

## ◆ remount() [2/4]

void Gio::Mount::remount | ( | const Glib::RefPtr< MountOperation >& | operation,
|  | const SlotAsyncReady& | slot,
|  | MountFlags | flags = `MountFlags::NONE`
| ) |  |

Remounts a mount.

This is an asynchronous operation, and is finished by calling mount_finish() with the AsyncResult data returned in the callback slot.

Remounting is useful when some setting affecting the operation of the volume has been changed, as this may need a remount to take affect. While this is semantically equivalent with unmounting and then remounting, not all backends might need to actually be unmounted.

Parameters

  operation | A mount operation.
  slot | A callback which will be called when the operation is completed or canceled.
  flags | Flags affecting the operation.

## ◆ remount() [3/4]

void Gio::Mount::remount | ( | const Glib::RefPtr< MountOperation >& | operation,
|  | MountFlags | flags = `MountFlags::NONE`
| ) |  |

Remounts a mount.

Remounting is useful when some setting affecting the operation of the volume has been changed, as this may need a remount to take affect. While this is semantically equivalent with unmounting and then remounting, not all backends might need to actually be unmounted.

Parameters

  operation | A mount operation.
  flags | Flags affecting the operation.

## ◆ remount() [4/4]

void Gio::Mount::remount | ( | MountFlags | flags = `MountFlags::NONE` | ) |

Remounts a mount, without user interaction.

Remounting is useful when some setting affecting the operation of the volume has been changed, as this may need a remount to take affect. While this is semantically equivalent with unmounting and then remounting, not all backends might need to actually be unmounted.

Parameters

  flags | Flags affecting the operation.

## ◆ remount_finish()

bool Gio::Mount::remount_finish | ( | const Glib::RefPtr< AsyncResult >& | result | ) |

Finishes remounting a mount.

If any errors occurred during the operation, error will be set to contain the errors and `false` will be returned.

Parameters

  result | A AsyncResult.

Returns
  `true` if the mount was successfully remounted. `false` otherwise.

Exceptions

  Glib::Error |

## ◆ shadow()

void Gio::Mount::shadow | ( |  | ) |

Increments the shadow count on mount.

Usually used by VolumeMonitor implementations when creating a shadow mount for mount, see g_mount_is_shadowed() for more information. The caller will need to emit the Mount::signal_changed() signal on mount manually.

Since glibmm 2.20:

## ◆ signal_changed()

Glib::SignalProxy<void()> Gio::Mount::signal_changed | ( |  | ) |

Slot Prototype:
  `void on_my_changed()`

Flags: Run Last

Emitted when the mount has been changed.

## ◆ signal_pre_unmount()

Glib::SignalProxy<void()> Gio::Mount::signal_pre_unmount | ( |  | ) |

Slot Prototype:
  `void on_my_pre_unmount()`

Flags: Run Last

This signal may be emitted when the Mount is about to be unmounted.

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

Since glibmm 2.22:

## ◆ signal_unmounted()

Glib::SignalProxy<void()> Gio::Mount::signal_unmounted | ( |  | ) |

Slot Prototype:
  `void on_my_unmounted()`

Flags: Run Last

This signal is emitted when the Mount have been unmounted. If the recipient is holding references to the object they should release them so the object can be finalized.

## ◆ unmount() [1/6]

void Gio::Mount::unmount | ( | const SlotAsyncReady& | slot,
|  | const Glib::RefPtr< Cancellable >& | cancellable,
|  | UnmountFlags | flags = `UnmountFlags::NONE`
| ) |  |

## ◆ unmount() [2/6]

void Gio::Mount::unmount | ( | const SlotAsyncReady& | slot,
|  | UnmountFlags | flags = `UnmountFlags::NONE`
| ) |  |

## ◆ unmount() [3/6]

void Gio::Mount::unmount | ( | UnmountFlags | flags = `UnmountFlags::NONE` | ) |

## ◆ unmount() [4/6]

void Gio::Mount::unmount | ( | const Glib::RefPtr< MountOperation >& | mount_operation,
|  | UnmountFlags | flags = `UnmountFlags::NONE`
| ) |  |

## ◆ unmount() [5/6]

void Gio::Mount::unmount | ( | const Glib::RefPtr< MountOperation >& | mount_operation,
|  | const SlotAsyncReady& | slot,
|  | UnmountFlags | flags = `UnmountFlags::NONE`
| ) |  |

## ◆ unmount() [6/6]

void Gio::Mount::unmount | ( | const Glib::RefPtr< MountOperation >& | mount_operation,
|  | const SlotAsyncReady& | slot,
|  | const Glib::RefPtr< Cancellable >& | cancellable,
|  | UnmountFlags | flags = `UnmountFlags::NONE`
| ) |  |

## ◆ unmount_finish()

bool Gio::Mount::unmount_finish | ( | const Glib::RefPtr< AsyncResult >& | result | ) |

Finishes unmounting a mount.

If any errors occurred during the operation, error will be set to contain the errors and `false` will be returned.

Since glibmm 2.22:

Parameters

  result | A AsyncResult.

Returns
  `true` if the mount was successfully unmounted. `false` otherwise.

Exceptions

  Glib::Error |

## ◆ unshadow()

void Gio::Mount::unshadow | ( |  | ) |

Decrements the shadow count on mount.

Usually used by VolumeMonitor implementations when destroying a shadow mount for mount, see g_mount_is_shadowed() for more information. The caller will need to emit the Mount::signal_changed() signal on mount manually.

Since glibmm 2.20:

## Friends And Related Function Documentation

## ◆ wrap()

Glib::RefPtr< Gio::Mount > wrap | ( | GMount * | object,
|  | bool | take_copy = `false`
| ) |  |
| related

A Glib::wrap() method for this object.

Parameters

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns
  A C++ instance that wraps this C instance.