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_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_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_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::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 |
|
The parent interface. |
|
changed |
|
No description available. | |
unmounted |
|
No description available. | |
get_root |
|
No description available. | |
get_name |
|
No description available. | |
get_icon |
|
No description available. | |
get_uuid |
|
No description available. | |
get_volume |
|
No description available. | |
get_drive |
|
No description available. | |
can_unmount |
|
No description available. | |
can_eject |
|
No description available. | |
unmount |
|
No description available. | |
unmount_finish |
|
No description available. | |
eject |
|
No description available. | |
eject_finish |
|
No description available. | |
remount |
|
No description available. | |
remount_finish |
|
No description available. | |
guess_content_type |
|
No description available. | |
guess_content_type_finish |
|
No description available. | |
guess_content_type_sync |
|
No description available. | |
pre_unmount |
|
No description available. | |
unmount_with_operation |
|
No description available. | |
unmount_with_operation_finish |
|
No description available. | |
eject_with_operation |
|
No description available. | |
eject_with_operation_finish |
|
No description available. | |
get_default_location |
|
No description available. | |
get_sort_key |
|
No description available. | |
get_symbolic_icon |
|
No description available. |
Virtual methods
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_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.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.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