MountT

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 #GAsyncReady structure will be passed to the callback. That callback should then call g_mount_unmount_with_operation_finish() with the #GMount and the #GAsyncReady 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.

template MountT (
TStruct
) {}

Members

Classes

OnChangedDelegateWrapper
class OnChangedDelegateWrapper
Undocumented in source.
OnPreUnmountDelegateWrapper
class OnPreUnmountDelegateWrapper
Undocumented in source.
OnUnmountedDelegateWrapper
class OnUnmountedDelegateWrapper
Undocumented in source.

Functions

addOnChanged
gulong addOnChanged(void delegate(MountIF) dlg, ConnectFlags connectFlags)

Emitted when the mount has been changed.

addOnPreUnmount
gulong addOnPreUnmount(void delegate(MountIF) dlg, ConnectFlags connectFlags)

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

addOnUnmounted
gulong addOnUnmounted(void delegate(MountIF) dlg, ConnectFlags connectFlags)

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.

canEject
bool canEject()

Checks if @mount can be ejected.

canUnmount
bool canUnmount()

Checks if @mount can be unmounted.

eject
void eject(GMountUnmountFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)

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.

ejectFinish
bool ejectFinish(AsyncResultIF 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.

ejectWithOperation
void ejectWithOperation(GMountUnmountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)

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.

ejectWithOperationFinish
bool ejectWithOperationFinish(AsyncResultIF 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.

getDefaultLocation
FileIF getDefaultLocation()

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

getDrive
DriveIF getDrive()

Gets the drive for the @mount.

getIcon
IconIF getIcon()

Gets the icon for @mount.

getMountStruct
GMount* getMountStruct(bool transferOwnership)

Get the main Gtk struct

getName
string getName()

Gets the name of @mount.

getRoot
FileIF getRoot()

Gets the root directory on @mount.

getSortKey
string getSortKey()

Gets the sort key for @mount, if any.

getSymbolicIcon
IconIF getSymbolicIcon()

Gets the symbolic icon for @mount.

getUuid
string getUuid()

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.

getVolume
VolumeIF getVolume()

Gets the volume for the @mount.

guessContentType
void guessContentType(bool forceRescan, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)

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.

guessContentTypeFinish
string[] guessContentTypeFinish(AsyncResultIF result)

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.

guessContentTypeSync
string[] guessContentTypeSync(bool forceRescan, Cancellable cancellable)

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.

isShadowed
bool isShadowed()

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

remount
void remount(GMountMountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)

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.

remountFinish
bool remountFinish(AsyncResultIF 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.

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

unmount
void unmount(GMountUnmountFlags flags, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)

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.

unmountFinish
bool unmountFinish(AsyncResultIF 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.

unmountWithOperation
void unmountWithOperation(GMountUnmountFlags flags, MountOperation mountOperation, Cancellable cancellable, GAsyncReadyCallback callback, void* userData)

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.

unmountWithOperationFinish
bool unmountWithOperationFinish(AsyncResultIF 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.

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

Static functions

callBackChanged
void callBackChanged(GMount* mountStruct, OnChangedDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackChangedDestroy
void callBackChangedDestroy(OnChangedDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackPreUnmount
void callBackPreUnmount(GMount* mountStruct, OnPreUnmountDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackPreUnmountDestroy
void callBackPreUnmountDestroy(OnPreUnmountDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackUnmounted
void callBackUnmounted(GMount* mountStruct, OnUnmountedDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackUnmountedDestroy
void callBackUnmountedDestroy(OnUnmountedDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

onChangedListeners
OnChangedDelegateWrapper[] onChangedListeners;
Undocumented in source.
onPreUnmountListeners
OnPreUnmountDelegateWrapper[] onPreUnmountListeners;
Undocumented in source.
onUnmountedListeners
OnUnmountedDelegateWrapper[] onUnmountedListeners;
Undocumented in source.

Meta