#include "gioerror.h"
#include "glibintl.h"
-#include "gioalias.h"
/**
* SECTION:gvolume
* equivalent of #GnomeVFSDrive.
*
* Mounting a #GVolume instance is an asynchronous operation. For more
- * information about asynchronous operations, see #GAsyncReady and
- * #GSimpleAsyncReady. To mount a #GVolume, first call
+ * information about asynchronous operations, see #GAsyncResult and
+ * #GSimpleAsyncResult. To mount a #GVolume, first call
* g_volume_mount() with (at least) the #GVolume instance, optionally
* a #GMountOperation object and a #GAsyncReadyCallback.
*
* when the gvfs hal volume monitor is in use. Other volume monitors
* will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE
* identifier, which can be used to obtain a hal device by means of
- * libhal_manger_find_device_string_match().
+ * libhal_manager_find_device_string_match().
*/
typedef GVolumeIface GVolumeInterface;
*
* Gets the icon for @volume.
*
- * Returns: a #GIcon.
+ * Returns: (transfer full): a #GIcon.
* The returned object should be unreffed with g_object_unref()
* when no longer needed.
**/
*
* Gets the drive for the @volume.
*
- * Returns: a #GDrive or %NULL if @volume is not associated with a drive.
+ * Returns: (transfer full): a #GDrive or %NULL if @volume is not associated with a drive.
* The returned object should be unreffed with g_object_unref()
* when no longer needed.
**/
*
* Gets the mount for the @volume.
*
- * Returns: a #GMount or %NULL if @volume isn't mounted.
+ * Returns: (transfer full): a #GMount or %NULL if @volume isn't mounted.
* The returned object should be unreffed with g_object_unref()
* when no longer needed.
**/
* g_volume_mount:
* @volume: a #GVolume.
* @flags: flags affecting the operation
- * @mount_operation: a #GMountOperation or %NULL to avoid user interaction.
- * @cancellable: optional #GCancellable object, %NULL to ignore.
- * @callback: a #GAsyncReadyCallback, or %NULL.
+ * @mount_operation: (allow-none): a #GMountOperation or %NULL to avoid user interaction.
+ * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
+ * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
* @user_data: user data that gets passed to @callback
*
* Mounts a volume. This is an asynchronous operation, and is
* finished by calling g_volume_mount_finish() with the @volume
* and #GAsyncResult returned in the @callback.
+ *
+ * Virtual: mount_fn
**/
void
g_volume_mount (GVolume *volume,
* @result: a #GAsyncResult
* @error: a #GError location to store an error, or %NULL to ignore
*
- * Finishes mounting a volume. If any errors occured during the operation,
+ * Finishes mounting a volume. If any errors occurred during the operation,
* @error will be set to contain the errors and %FALSE will be returned.
*
* If the mount operation succeeded, g_volume_get_mount() on @volume
* g_volume_eject:
* @volume: a #GVolume.
* @flags: flags affecting the unmount if required for eject
- * @cancellable: optional #GCancellable object, %NULL to ignore.
- * @callback: a #GAsyncReadyCallback, or %NULL.
+ * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
+ * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
* @user_data: user data that gets passed to @callback
*
* Ejects a volume. This is an asynchronous operation, and is
* @result: a #GAsyncResult.
* @error: a #GError location to store an error, or %NULL to ignore
*
- * Finishes ejecting a volume. If any errors occured during the operation,
+ * Finishes ejecting a volume. If any errors occurred during the operation,
* @error will be set to contain the errors and %FALSE will be returned.
*
* Returns: %TRUE, %FALSE if operation failed.
* g_volume_eject_with_operation:
* @volume: a #GVolume.
* @flags: flags affecting the unmount if required for eject
- * @mount_operation: a #GMountOperation or %NULL to avoid user interaction.
- * @cancellable: optional #GCancellable object, %NULL to ignore.
- * @callback: a #GAsyncReadyCallback, or %NULL.
+ * @mount_operation: (allow-none): a #GMountOperation or %NULL to
+ * avoid user interaction.
+ * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore.
+ * @callback: (allow-none): a #GAsyncReadyCallback, or %NULL.
* @user_data: user data passed to @callback.
*
* Ejects a volume. This is an asynchronous operation, and is
* g_volume_eject_with_operation_finish:
* @volume: a #GVolume.
* @result: a #GAsyncResult.
- * @error: a #GError location to store the error occuring, or %NULL to
+ * @error: a #GError location to store the error occurring, or %NULL to
* ignore.
*
* Finishes ejecting a volume. If any errors occurred during the operation,
* @volume: a #GVolume
*
* Gets the kinds of <link linkend="volume-identifier">identifiers</link>
- * that @volume has. Use g_volume_get_identifer() to obtain
+ * that @volume has. Use g_volume_get_identifier() to obtain
* the identifiers themselves.
*
- * Returns: a %NULL-terminated array of strings containing
- * kinds of identifiers. Use g_strfreev() to free.
+ * Returns: (array zero-terminated=1) (transfer full): a %NULL-terminated array
+ * of strings containing kinds of identifiers. Use g_strfreev() to free.
*/
char **
g_volume_enumerate_identifiers (GVolume *volume)
* implementations to find the underlying mount to shadow, see
* g_mount_is_shadowed() for more details.
*
- * Returns: the activation root of @volume or %NULL. Use
+ * Returns: (transfer full): the activation root of @volume or %NULL. Use
* g_object_unref() to free.
*
* Since: 2.18
return (* iface->get_activation_root) (volume);
}
+/**
+ * g_volume_get_sort_key:
+ * @volume: A #GVolume.
+ *
+ * Gets the sort key for @volume, if any.
+ *
+ * Returns: Sorting key for @volume or %NULL if no such key is available.
+ *
+ * Since: 2.32
+ */
+const gchar *
+g_volume_get_sort_key (GVolume *volume)
+{
+ const gchar *ret = NULL;
+ GVolumeIface *iface;
+
+ g_return_val_if_fail (G_IS_VOLUME (volume), NULL);
+ iface = G_VOLUME_GET_IFACE (volume);
+ if (iface->get_sort_key != NULL)
+ ret = iface->get_sort_key (volume);
-#define __G_VOLUME_C__
-#include "gioaliasdef.c"
+ return ret;
+}