Interface

GioMount

Description

interface Gio.Mount : GObject.Object

The GMount interface represents user-visible mounts. Note, when porting from GnomeVFS, GMount is the moral equivalent of GnomeVFSVolume.

GMount 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. Might or might not be related to a volume object.

Unmounting a GMount instance is an asynchronous operation. For more information about asynchronous operations, see GAsyncResult and GTask. To unmount a GMount instance, first call g_mount_unmount_with_operation() with (at least) the GMount instance and a GAsyncReadyCallback. The callback will be fired when the operation has resolved (either with success or failure), and a GAsyncResult structure will be passed to the callback. That callback should then call g_mount_unmount_with_operation_finish() with the GMount and the GAsyncResult data to see if the operation was completed successfully. If an error is present when g_mount_unmount_with_operation_finish() is called, then it will be filled with any error information.

Prerequisite

In order to implement Mount, your type must inherit fromGObject.

Instance methods

g_mount_can_eject

Checks if mount can be ejected.

g_mount_can_unmount

Checks if mount can be unmounted.

g_mount_eject

Ejects a mount. This is an asynchronous operation, and is finished by calling g_mount_eject_finish() with the mount and GAsyncResult data returned in the callback.

deprecated: 2.22 

g_mount_eject_finish

Finishes ejecting a mount. If any errors occurred during the operation, error will be set to contain the errors and FALSE will be returned.

deprecated: 2.22 

g_mount_eject_with_operation

Ejects a mount. This is an asynchronous operation, and is finished by calling g_mount_eject_with_operation_finish() with the mount and GAsyncResult data returned in the callback.

since: 2.22

g_mount_eject_with_operation_finish

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: 2.22

g_mount_get_default_location

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

g_mount_get_drive

Gets the drive for the mount.

g_mount_get_icon

Gets the icon for mount.

g_mount_get_name

Gets the name of mount.

g_mount_get_root

Gets the root directory on mount.

g_mount_get_sort_key

Gets the sort key for mount, if any.

since: 2.32

g_mount_get_symbolic_icon

Gets the symbolic icon for mount.

since: 2.34

g_mount_get_uuid

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 NULL if there is no UUID available.

g_mount_get_volume

Gets the volume for the mount.

g_mount_guess_content_type

Tries to guess the type of content stored on 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.

since: 2.18

g_mount_guess_content_type_finish

Finishes guessing content types of mount. If any errors occurred during the operation, error will be set to contain the errors and FALSE will be returned. In particular, you may get an G_IO_ERROR_NOT_SUPPORTED if the mount does not support content guessing.

since: 2.18

g_mount_guess_content_type_sync

Tries to guess the type of content stored on 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.

since: 2.18

g_mount_is_shadowed

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

since: 2.20

g_mount_remount

Remounts a mount. This is an asynchronous operation, and is finished by calling g_mount_remount_finish() with the mount and GAsyncResults data returned in the callback.

g_mount_remount_finish

Finishes remounting a mount. If any errors occurred during the operation, error will be set to contain the errors and FALSE will be returned.

g_mount_shadow

Increments the shadow count on mount. Usually used by GVolumeMonitor implementations when creating a shadow mount for mount, see g_mount_is_shadowed() for more information. The caller will need to emit the GMount::changed signal on mount manually.

since: 2.20

g_mount_unmount

Unmounts a mount. This is an asynchronous operation, and is finished by calling g_mount_unmount_finish() with the mount and GAsyncResult data returned in the callback.

deprecated: 2.22 

g_mount_unmount_finish

Finishes unmounting a mount. If any errors occurred during the operation, error will be set to contain the errors and FALSE will be returned.

deprecated: 2.22 

g_mount_unmount_with_operation

Unmounts a mount. This is an asynchronous operation, and is finished by calling g_mount_unmount_with_operation_finish() with the mount and GAsyncResult data returned in the callback.

since: 2.22

g_mount_unmount_with_operation_finish

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: 2.22

g_mount_unshadow

Decrements the shadow count on mount. Usually used by GVolumeMonitor implementations when destroying a shadow mount for mount, see g_mount_is_shadowed() for more information. The caller will need to emit the GMount::changed signal on mount manually.

since: 2.20

Signals

Gio.Mount::changed

Emitted when the mount has been changed.

Gio.Mount::pre-unmount

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

since: 2.22

Gio.Mount::unmounted

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

Interface structure

struct GioMountIface {
  GTypeInterface g_iface;
  void (* changed) (
    GMount* mount
  );
  void (* unmounted) (
    GMount* mount
  );
  GFile* (* get_root) (
    GMount* mount
  );
  char* (* get_name) (
    GMount* mount
  );
  GIcon* (* get_icon) (
    GMount* mount
  );
  char* (* get_uuid) (
    GMount* mount
  );
  GVolume* (* get_volume) (
    GMount* mount
  );
  GDrive* (* get_drive) (
    GMount* mount
  );
  gboolean (* can_unmount) (
    GMount* mount
  );
  gboolean (* can_eject) (
    GMount* mount
  );
  void (* unmount) (
    GMount* mount,
    GMountUnmountFlags flags,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  );
  gboolean (* unmount_finish) (
    GMount* mount,
    GAsyncResult* result,
    GError** error
  );
  void (* eject) (
    GMount* mount,
    GMountUnmountFlags flags,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  );
  gboolean (* eject_finish) (
    GMount* mount,
    GAsyncResult* result,
    GError** error
  );
  void (* remount) (
    GMount* mount,
    GMountMountFlags flags,
    GMountOperation* mount_operation,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  );
  gboolean (* remount_finish) (
    GMount* mount,
    GAsyncResult* result,
    GError** error
  );
  void (* guess_content_type) (
    GMount* mount,
    gboolean force_rescan,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  );
  gchar** (* guess_content_type_finish) (
    GMount* mount,
    GAsyncResult* result,
    GError** error
  );
  gchar** (* guess_content_type_sync) (
    GMount* mount,
    gboolean force_rescan,
    GCancellable* cancellable,
    GError** error
  );
  void (* pre_unmount) (
    GMount* mount
  );
  void (* unmount_with_operation) (
    GMount* mount,
    GMountUnmountFlags flags,
    GMountOperation* mount_operation,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  );
  gboolean (* unmount_with_operation_finish) (
    GMount* mount,
    GAsyncResult* result,
    GError** error
  );
  void (* eject_with_operation) (
    GMount* mount,
    GMountUnmountFlags flags,
    GMountOperation* mount_operation,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  );
  gboolean (* eject_with_operation_finish) (
    GMount* mount,
    GAsyncResult* result,
    GError** error
  );
  GFile* (* get_default_location) (
    GMount* mount
  );
  const gchar* (* get_sort_key) (
    GMount* mount
  );
  GIcon* (* get_symbolic_icon) (
    GMount* mount
  );
  
}

Interface for implementing operations for mounts.

Interface members
g_iface
GTypeInterface
 

The parent interface.

changed
void (* changed) (
    GMount* mount
  )
 No description available.
unmounted
void (* unmounted) (
    GMount* mount
  )
 No description available.
get_root
GFile* (* get_root) (
    GMount* mount
  )
 No description available.
get_name
char* (* get_name) (
    GMount* mount
  )
 No description available.
get_icon
GIcon* (* get_icon) (
    GMount* mount
  )
 No description available.
get_uuid
char* (* get_uuid) (
    GMount* mount
  )
 No description available.
get_volume
GVolume* (* get_volume) (
    GMount* mount
  )
 No description available.
get_drive
GDrive* (* get_drive) (
    GMount* mount
  )
 No description available.
can_unmount
gboolean (* can_unmount) (
    GMount* mount
  )
 No description available.
can_eject
gboolean (* can_eject) (
    GMount* mount
  )
 No description available.
unmount
void (* unmount) (
    GMount* mount,
    GMountUnmountFlags flags,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  )
 No description available.
unmount_finish
gboolean (* unmount_finish) (
    GMount* mount,
    GAsyncResult* result,
    GError** error
  )
 No description available.
eject
void (* eject) (
    GMount* mount,
    GMountUnmountFlags flags,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  )
 No description available.
eject_finish
gboolean (* eject_finish) (
    GMount* mount,
    GAsyncResult* result,
    GError** error
  )
 No description available.
remount
void (* remount) (
    GMount* mount,
    GMountMountFlags flags,
    GMountOperation* mount_operation,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  )
 No description available.
remount_finish
gboolean (* remount_finish) (
    GMount* mount,
    GAsyncResult* result,
    GError** error
  )
 No description available.
guess_content_type
void (* guess_content_type) (
    GMount* mount,
    gboolean force_rescan,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  )
 No description available.
guess_content_type_finish
gchar** (* guess_content_type_finish) (
    GMount* mount,
    GAsyncResult* result,
    GError** error
  )
 No description available.
guess_content_type_sync
gchar** (* guess_content_type_sync) (
    GMount* mount,
    gboolean force_rescan,
    GCancellable* cancellable,
    GError** error
  )
 No description available.
pre_unmount
void (* pre_unmount) (
    GMount* mount
  )
 No description available.
unmount_with_operation
void (* unmount_with_operation) (
    GMount* mount,
    GMountUnmountFlags flags,
    GMountOperation* mount_operation,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  )
 No description available.
unmount_with_operation_finish
gboolean (* unmount_with_operation_finish) (
    GMount* mount,
    GAsyncResult* result,
    GError** error
  )
 No description available.
eject_with_operation
void (* eject_with_operation) (
    GMount* mount,
    GMountUnmountFlags flags,
    GMountOperation* mount_operation,
    GCancellable* cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data
  )
 No description available.
eject_with_operation_finish
gboolean (* eject_with_operation_finish) (
    GMount* mount,
    GAsyncResult* result,
    GError** error
  )
 No description available.
get_default_location
GFile* (* get_default_location) (
    GMount* mount
  )
 No description available.
get_sort_key
const gchar* (* get_sort_key) (
    GMount* mount
  )
 No description available.
get_symbolic_icon
GIcon* (* get_symbolic_icon) (
    GMount* mount
  )
 No description available.

Virtual methods

Gio.Mount.can_eject

Checks if mount can be ejected.

Gio.Mount.can_unmount

Checks if mount can be unmounted.

Gio.Mount.changed
No description available.

Gio.Mount.eject

Ejects a mount. This is an asynchronous operation, and is finished by calling g_mount_eject_finish() with the mount and GAsyncResult data returned in the callback.

deprecated: 2.22 

Gio.Mount.eject_finish

Finishes ejecting a mount. If any errors occurred during the operation, error will be set to contain the errors and FALSE will be returned.

deprecated: 2.22 

Gio.Mount.eject_with_operation

Ejects a mount. This is an asynchronous operation, and is finished by calling g_mount_eject_with_operation_finish() with the mount and GAsyncResult data returned in the callback.

since: 2.22

Gio.Mount.eject_with_operation_finish

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: 2.22

Gio.Mount.get_default_location

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

Gio.Mount.get_drive

Gets the drive for the mount.

Gio.Mount.get_icon

Gets the icon for mount.

Gio.Mount.get_name

Gets the name of mount.

Gio.Mount.get_root

Gets the root directory on mount.

Gio.Mount.get_sort_key

Gets the sort key for mount, if any.

since: 2.32

Gio.Mount.get_symbolic_icon

Gets the symbolic icon for mount.

since: 2.34

Gio.Mount.get_uuid

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 NULL if there is no UUID available.

Gio.Mount.get_volume

Gets the volume for the mount.

Gio.Mount.guess_content_type

Tries to guess the type of content stored on 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.

since: 2.18

Gio.Mount.guess_content_type_finish

Finishes guessing content types of mount. If any errors occurred during the operation, error will be set to contain the errors and FALSE will be returned. In particular, you may get an G_IO_ERROR_NOT_SUPPORTED if the mount does not support content guessing.

since: 2.18

Gio.Mount.guess_content_type_sync

Tries to guess the type of content stored on 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.

since: 2.18

Gio.Mount.pre_unmount
No description available.

Gio.Mount.remount

Remounts a mount. This is an asynchronous operation, and is finished by calling g_mount_remount_finish() with the mount and GAsyncResults data returned in the callback.

Gio.Mount.remount_finish

Finishes remounting a mount. If any errors occurred during the operation, error will be set to contain the errors and FALSE will be returned.

Gio.Mount.unmount

Unmounts a mount. This is an asynchronous operation, and is finished by calling g_mount_unmount_finish() with the mount and GAsyncResult data returned in the callback.

deprecated: 2.22 

Gio.Mount.unmount_finish

Finishes unmounting a mount. If any errors occurred during the operation, error will be set to contain the errors and FALSE will be returned.

deprecated: 2.22 

Gio.Mount.unmount_with_operation

Unmounts a mount. This is an asynchronous operation, and is finished by calling g_mount_unmount_with_operation_finish() with the mount and GAsyncResult data returned in the callback.

since: 2.22

Gio.Mount.unmount_with_operation_finish

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: 2.22

Gio.Mount.unmounted
No description available.