From e3fdcd1fa78c831f5cea78cf0a2c07bfdb4b6561 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 11 Feb 2008 11:12:36 +0000 Subject: [PATCH] Added GMountMountFlags enum and added a flags argument to all mount calls. 2008-02-11 Alexander Larsson * gfile.[ch]: * gmount.[ch]: * gvolume.[ch]: Added GMountMountFlags enum and added a flags argument to all mount calls. This is an API/ABI change for future extensibility, as I think we will need at least an inhibit-autorun flag (the panel needs this). There are no flags defined yet though. svn path=/trunk/; revision=6497 --- gio/ChangeLog | 13 +++++++++++++ gio/gfile.c | 7 ++++++- gio/gfile.h | 18 +++++++++++++++++- gio/gmount.c | 4 +++- gio/gmount.h | 2 ++ gio/gvolume.c | 4 +++- gio/gvolume.h | 2 ++ 7 files changed, 46 insertions(+), 4 deletions(-) diff --git a/gio/ChangeLog b/gio/ChangeLog index 40ec1875b..c47b55d24 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,16 @@ +2008-02-11 Alexander Larsson + + * gfile.[ch]: + * gmount.[ch]: + * gvolume.[ch]: + Added GMountMountFlags enum and added a flags + argument to all mount calls. + + This is an API/ABI change for future extensibility, + as I think we will need at least an + inhibit-autorun flag (the panel needs this). + There are no flags defined yet though. + 2008-02-11 Alexander Larsson * gfileinfo.h: diff --git a/gio/gfile.c b/gio/gfile.c index cb9f60b68..4a1ccb19f 100644 --- a/gio/gfile.c +++ b/gio/gfile.c @@ -3277,6 +3277,7 @@ g_file_set_attribute_int64 (GFile *file, /** * g_file_mount_mountable: * @file: input #GFile. + * @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 to call when the request is satisfied, or %NULL. @@ -3295,6 +3296,7 @@ g_file_set_attribute_int64 (GFile *file, **/ void g_file_mount_mountable (GFile *file, + GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, @@ -3315,6 +3317,7 @@ g_file_mount_mountable (GFile *file, _("Operation not supported")); (* iface->mount_mountable) (file, + flags, mount_operation, cancellable, callback, @@ -4491,6 +4494,7 @@ g_file_new_for_commandline_arg (const char *arg) /** * g_file_mount_enclosing_volume: * @location: input #GFile. + * @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 to call when the request is satisfied, or %NULL. @@ -4508,6 +4512,7 @@ g_file_new_for_commandline_arg (const char *arg) **/ void g_file_mount_enclosing_volume (GFile *location, + GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, @@ -4529,7 +4534,7 @@ g_file_mount_enclosing_volume (GFile *location, return; } - (* iface->mount_enclosing_volume) (location, mount_operation, cancellable, callback, user_data); + (* iface->mount_enclosing_volume) (location, flags, mount_operation, cancellable, callback, user_data); } diff --git a/gio/gfile.h b/gio/gfile.h index 0072224ea..84e5169c5 100644 --- a/gio/gfile.h +++ b/gio/gfile.h @@ -67,13 +67,25 @@ typedef enum { G_FILE_CREATE_PRIVATE = (1<<0) } GFileCreateFlags; + +/** + * GMountMountFlags: + * @G_MOUNT_MOUNT_NONE: No flags set. + * + * Flags used when mounting a mount. + */ +typedef enum { + G_MOUNT_MOUNT_NONE = 0, +} GMountMountFlags; + + /** * GMountUnmountFlags: * @G_MOUNT_UNMOUNT_NONE: No flags set. * @G_MOUNT_UNMOUNT_FORCE: Unmount even if there are outstanding * file operations on the mount. * - * Flags used when an operation may create a file. + * Flags used when an unmounting a mount. */ typedef enum { G_MOUNT_UNMOUNT_NONE = 0, @@ -493,6 +505,7 @@ struct _GFileIface void (*mount_mountable) (GFile *file, + GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, @@ -519,6 +532,7 @@ struct _GFileIface void (*mount_enclosing_volume) (GFile *location, + GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, @@ -788,6 +802,7 @@ gboolean g_file_set_attribute_int64 (GFile GCancellable *cancellable, GError **error); void g_file_mount_enclosing_volume (GFile *location, + GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, @@ -796,6 +811,7 @@ gboolean g_file_mount_enclosing_volume_finish (GFile GAsyncResult *result, GError **error); void g_file_mount_mountable (GFile *file, + GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, diff --git a/gio/gmount.c b/gio/gmount.c index 71fa51b89..f39020f4e 100644 --- a/gio/gmount.c +++ b/gio/gmount.c @@ -454,6 +454,7 @@ g_mount_eject_finish (GMount *mount, /** * g_mount_remount: * @mount: a #GMount. + * @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. @@ -471,6 +472,7 @@ g_mount_eject_finish (GMount *mount, **/ void g_mount_remount (GMount *mount, + GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, @@ -492,7 +494,7 @@ g_mount_remount (GMount *mount, return; } - (* iface->remount) (mount, mount_operation, cancellable, callback, user_data); + (* iface->remount) (mount, flags, mount_operation, cancellable, callback, user_data); } /** diff --git a/gio/gmount.h b/gio/gmount.h index 8681854bd..c2474d569 100644 --- a/gio/gmount.h +++ b/gio/gmount.h @@ -113,6 +113,7 @@ struct _GMountIface GAsyncResult *result, GError **error); void (*remount) (GMount *mount, + GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, @@ -149,6 +150,7 @@ gboolean g_mount_eject_finish (GMount *mount, GAsyncResult *result, GError **error); void g_mount_remount (GMount *mount, + GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, diff --git a/gio/gvolume.c b/gio/gvolume.c index 3aa174daf..642ccd192 100644 --- a/gio/gvolume.c +++ b/gio/gvolume.c @@ -328,6 +328,7 @@ g_volume_should_automount (GVolume *volume) /** * 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. @@ -337,6 +338,7 @@ g_volume_should_automount (GVolume *volume) **/ void g_volume_mount (GVolume *volume, + GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, @@ -357,7 +359,7 @@ g_volume_mount (GVolume *volume, return; } - (* iface->mount_fn) (volume, mount_operation, cancellable, callback, user_data); + (* iface->mount_fn) (volume, flags, mount_operation, cancellable, callback, user_data); } /** diff --git a/gio/gvolume.h b/gio/gvolume.h index c46220111..f1ec0f5f1 100644 --- a/gio/gvolume.h +++ b/gio/gvolume.h @@ -120,6 +120,7 @@ struct _GVolumeIface gboolean (*can_mount) (GVolume *volume); gboolean (*can_eject) (GVolume *volume); void (*mount_fn) (GVolume *volume, + GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback, @@ -155,6 +156,7 @@ gboolean g_volume_can_mount (GVolume *volume); gboolean g_volume_can_eject (GVolume *volume); gboolean g_volume_should_automount (GVolume *volume); void g_volume_mount (GVolume *volume, + GMountMountFlags flags, GMountOperation *mount_operation, GCancellable *cancellable, GAsyncReadyCallback callback,