summaryrefslogtreecommitdiff
path: root/gio/gfile.c
diff options
context:
space:
mode:
authorKarol Lewandowski <k.lewandowsk@samsung.com>2024-01-03 15:59:40 +0100
committerKarol Lewandowski <k.lewandowsk@samsung.com>2024-01-03 15:59:40 +0100
commit1b11ff8d06ac53ccc79aa7595e2cd7b7972507f3 (patch)
tree77b766225dc9a54292b9a2ceece11041f64cc5d9 /gio/gfile.c
parentcbef7bb66192abf9d98aba079fe5236a8fb54e6f (diff)
downloadglib-1b11ff8d06ac53ccc79aa7595e2cd7b7972507f3.tar.gz
glib-1b11ff8d06ac53ccc79aa7595e2cd7b7972507f3.tar.bz2
glib-1b11ff8d06ac53ccc79aa7595e2cd7b7972507f3.zip
Imported Upstream version 2.72.3
Diffstat (limited to 'gio/gfile.c')
-rw-r--r--gio/gfile.c720
1 files changed, 471 insertions, 249 deletions
diff --git a/gio/gfile.c b/gio/gfile.c
index d7feca6b9..1810e3682 100644
--- a/gio/gfile.c
+++ b/gio/gfile.c
@@ -247,6 +247,18 @@ static void g_file_real_trash_async (GFile
static gboolean g_file_real_trash_finish (GFile *file,
GAsyncResult *res,
GError **error);
+static void g_file_real_move_async (GFile *source,
+ GFile *destination,
+ GFileCopyFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GFileProgressCallback progress_callback,
+ gpointer progress_callback_data,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+static gboolean g_file_real_move_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error);
static void g_file_real_make_directory_async (GFile *file,
int io_priority,
GCancellable *cancellable,
@@ -381,6 +393,8 @@ g_file_default_init (GFileIface *iface)
iface->delete_file_finish = g_file_real_delete_finish;
iface->trash_async = g_file_real_trash_async;
iface->trash_finish = g_file_real_trash_finish;
+ iface->move_async = g_file_real_move_async;
+ iface->move_finish = g_file_real_move_finish;
iface->make_directory_async = g_file_real_make_directory_async;
iface->make_directory_finish = g_file_real_make_directory_finish;
iface->open_readwrite_async = g_file_real_open_readwrite_async;
@@ -441,8 +455,8 @@ g_file_is_native (GFile *file)
* This call does no blocking I/O.
*
* Returns: %TRUE if #GFile's backend supports the
- * given URI scheme, %FALSE if URI scheme is %NULL,
- * not supported, or #GFile is invalid.
+ * given URI scheme, %FALSE if URI scheme is %NULL,
+ * not supported, or #GFile is invalid.
*/
gboolean
g_file_has_uri_scheme (GFile *file,
@@ -476,8 +490,8 @@ g_file_has_uri_scheme (GFile *file,
* This call does no blocking I/O.
*
* Returns: (nullable): a string containing the URI scheme for the given
- * #GFile or %NULL if the #GFile was constructed with an invalid URI. The
- * returned string should be freed with g_free() when no longer needed.
+ * #GFile or %NULL if the #GFile was constructed with an invalid URI. The
+ * returned string should be freed with g_free() when no longer needed.
*/
char *
g_file_get_uri_scheme (GFile *file)
@@ -511,8 +525,8 @@ g_file_get_uri_scheme (GFile *file)
* This call does no blocking I/O.
*
* Returns: (type filename) (nullable): string containing the #GFile's
- * base name, or %NULL if given #GFile is invalid. The returned string
- * should be freed with g_free() when no longer needed.
+ * base name, or %NULL if given #GFile is invalid. The returned string
+ * should be freed with g_free() when no longer needed.
*/
char *
g_file_get_basename (GFile *file)
@@ -536,8 +550,8 @@ g_file_get_basename (GFile *file)
* This call does no blocking I/O.
*
* Returns: (type filename) (nullable): string containing the #GFile's path,
- * or %NULL if no such path exists. The returned string should be freed
- * with g_free() when no longer needed.
+ * or %NULL if no such path exists. The returned string should be freed
+ * with g_free() when no longer needed.
*/
char *
g_file_get_path (GFile *file)
@@ -609,7 +623,7 @@ file_peek_path_generic (GFile *file)
* This call does no blocking I/O.
*
* Returns: (type filename) (nullable): string containing the #GFile's path,
- * or %NULL if no such path exists. The returned string is owned by @file.
+ * or %NULL if no such path exists. The returned string is owned by @file.
* Since: 2.56
*/
const char *
@@ -629,9 +643,9 @@ g_file_peek_path (GFile *file)
* This call does no blocking I/O.
*
* Returns: a string containing the #GFile's URI. If the #GFile was constructed
- * with an invalid URI, an invalid URI is returned.
- * The returned string should be freed with g_free()
- * when no longer needed.
+ * with an invalid URI, an invalid URI is returned.
+ * The returned string should be freed with g_free()
+ * when no longer needed.
*/
char *
g_file_get_uri (GFile *file)
@@ -665,8 +679,8 @@ g_file_get_uri (GFile *file)
* This call does no blocking I/O.
*
* Returns: a string containing the #GFile's parse name.
- * The returned string should be freed with g_free()
- * when no longer needed.
+ * The returned string should be freed with g_free()
+ * when no longer needed.
*/
char *
g_file_get_parse_name (GFile *file)
@@ -696,7 +710,7 @@ g_file_get_parse_name (GFile *file)
* This call does no blocking I/O.
*
* Returns: (transfer full): a new #GFile that is a duplicate
- * of the given #GFile.
+ * of the given #GFile.
*/
GFile *
g_file_dup (GFile *file)
@@ -720,9 +734,9 @@ g_file_dup (GFile *file)
*
* Virtual: hash
* Returns: 0 if @file is not a valid #GFile, otherwise an
- * integer that can be used as hash value for the #GFile.
- * This function is intended for easily hashing a #GFile to
- * add to a #GHashTable or similar data structure.
+ * integer that can be used as hash value for the #GFile.
+ * This function is intended for easily hashing a #GFile to
+ * add to a #GHashTable or similar data structure.
*/
guint
g_file_hash (gconstpointer file)
@@ -783,8 +797,8 @@ g_file_equal (GFile *file1,
* This call does no blocking I/O.
*
* Returns: (nullable) (transfer full): a #GFile structure to the
- * parent of the given #GFile or %NULL if there is no parent. Free
- * the returned object with g_object_unref().
+ * parent of the given #GFile or %NULL if there is no parent. Free
+ * the returned object with g_object_unref().
*/
GFile *
g_file_get_parent (GFile *file)
@@ -810,7 +824,7 @@ g_file_get_parent (GFile *file)
* if @file is an immediate child of @parent.
*
* Returns: %TRUE if @file is an immediate child of @parent (or any parent in
- * the case that @parent is %NULL).
+ * the case that @parent is %NULL).
*
* Since: 2.24
*/
@@ -855,7 +869,7 @@ g_file_has_parent (GFile *file,
* This call does no blocking I/O.
*
* Returns: (transfer full): a #GFile to a child specified by @name.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*/
GFile *
g_file_get_child (GFile *file,
@@ -863,6 +877,7 @@ g_file_get_child (GFile *file,
{
g_return_val_if_fail (G_IS_FILE (file), NULL);
g_return_val_if_fail (name != NULL, NULL);
+ g_return_val_if_fail (!g_path_is_absolute (name), NULL);
return g_file_resolve_relative_path (file, name);
}
@@ -883,8 +898,8 @@ g_file_get_child (GFile *file,
* This call does no blocking I/O.
*
* Returns: (transfer full): a #GFile to the specified child, or
- * %NULL if the display name couldn't be converted.
- * Free the returned object with g_object_unref().
+ * %NULL if the display name couldn't be converted.
+ * Free the returned object with g_object_unref().
*/
GFile *
g_file_get_child_for_display_name (GFile *file,
@@ -923,7 +938,7 @@ g_file_get_child_for_display_name (GFile *file,
*
* Virtual: prefix_matches
* Returns: %TRUE if the @file's parent, grandparent, etc is @prefix,
- * %FALSE otherwise.
+ * %FALSE otherwise.
*/
gboolean
g_file_has_prefix (GFile *file,
@@ -955,9 +970,9 @@ g_file_has_prefix (GFile *file,
* This call does no blocking I/O.
*
* Returns: (type filename) (nullable): string with the relative path from
- * @descendant to @parent, or %NULL if @descendant doesn't have @parent as
- * prefix. The returned string should be freed with g_free() when
- * no longer needed.
+ * @descendant to @parent, or %NULL if @descendant doesn't have @parent as
+ * prefix. The returned string should be freed with g_free() when
+ * no longer needed.
*/
char *
g_file_get_relative_path (GFile *parent,
@@ -985,9 +1000,10 @@ g_file_get_relative_path (GFile *parent,
*
* This call does no blocking I/O.
*
- * Returns: (transfer full): #GFile to the resolved path.
- * %NULL if @relative_path is %NULL or if @file is invalid.
- * Free the returned object with g_object_unref().
+ * If the @relative_path is an absolute path name, the resolution
+ * is done absolutely (without taking @file path as base).
+ *
+ * Returns: (transfer full): a #GFile for the resolved path.
*/
GFile *
g_file_resolve_relative_path (GFile *file,
@@ -1009,7 +1025,7 @@ g_file_resolve_relative_path (GFile *file,
* @attributes: an attribute query string
* @flags: a set of #GFileQueryInfoFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: #GError for error reporting
*
* Gets the requested information about the files in a directory.
@@ -1025,7 +1041,9 @@ g_file_resolve_relative_path (GFile *file,
* "standard::*" means all attributes in the standard namespace.
* An example attribute query be "standard::*,owner::user".
* The standard attributes are available as defines, like
- * #G_FILE_ATTRIBUTE_STANDARD_NAME.
+ * %G_FILE_ATTRIBUTE_STANDARD_NAME. %G_FILE_ATTRIBUTE_STANDARD_NAME should
+ * always be specified if you plan to call g_file_enumerator_get_child() or
+ * g_file_enumerator_iterate() on the returned enumerator.
*
* If @cancellable is not %NULL, then the operation can be cancelled
* by triggering the cancellable object from another thread. If the
@@ -1037,7 +1055,7 @@ g_file_resolve_relative_path (GFile *file,
* error will be returned. Other errors are possible too.
*
* Returns: (transfer full): A #GFileEnumerator if successful,
- * %NULL on error. Free the returned object with g_object_unref().
+ * %NULL on error. Free the returned object with g_object_unref().
*/
GFileEnumerator *
g_file_enumerate_children (GFile *file,
@@ -1074,9 +1092,9 @@ g_file_enumerate_children (GFile *file,
* @flags: a set of #GFileQueryInfoFlags
* @io_priority: the [I/O priority][io-priority] of the request
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async): a #GAsyncReadyCallback to call when the
- * request is satisfied
+ * request is satisfied
* @user_data: (closure): the data to pass to callback function
*
* Asynchronously gets the requested information about the files
@@ -1123,8 +1141,8 @@ g_file_enumerate_children_async (GFile *file,
* See g_file_enumerate_children_async().
*
* Returns: (transfer full): a #GFileEnumerator or %NULL
- * if an error occurred.
- * Free the returned object with g_object_unref().
+ * if an error occurred.
+ * Free the returned object with g_object_unref().
*/
GFileEnumerator *
g_file_enumerate_children_finish (GFile *file,
@@ -1147,7 +1165,7 @@ g_file_enumerate_children_finish (GFile *file,
* g_file_query_exists:
* @file: input #GFile
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
*
* Utility function to check if a particular file exists. This is
* implemented using g_file_query_info() and as such does blocking I/O.
@@ -1173,7 +1191,7 @@ g_file_enumerate_children_finish (GFile *file,
* that can happen due to races when you execute the operation.
*
* Returns: %TRUE if the file exists (and can be detected without error),
- * %FALSE otherwise (or if cancelled).
+ * %FALSE otherwise (or if cancelled).
*/
gboolean
g_file_query_exists (GFile *file,
@@ -1199,7 +1217,7 @@ g_file_query_exists (GFile *file,
* @file: input #GFile
* @flags: a set of #GFileQueryInfoFlags passed to g_file_query_info()
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
*
* Utility function to inspect the #GFileType of a file. This is
* implemented using g_file_query_info() and as such does blocking I/O.
@@ -1207,8 +1225,8 @@ g_file_query_exists (GFile *file,
* The primary use case of this method is to check if a file is
* a regular file, directory, or symlink.
*
- * Returns: The #GFileType of the file and #G_FILE_TYPE_UNKNOWN
- * if the file does not exist
+ * Returns: The #GFileType of the file and %G_FILE_TYPE_UNKNOWN
+ * if the file does not exist
*
* Since: 2.18
*/
@@ -1240,7 +1258,7 @@ g_file_query_file_type (GFile *file,
* @attributes: an attribute query string
* @flags: a set of #GFileQueryInfoFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError
*
* Gets the requested information about specified @file.
@@ -1256,7 +1274,7 @@ g_file_query_file_type (GFile *file,
* "standard::*" means all attributes in the standard namespace.
* An example attribute query be "standard::*,owner::user".
* The standard attributes are available as defines, like
- * #G_FILE_ATTRIBUTE_STANDARD_NAME.
+ * %G_FILE_ATTRIBUTE_STANDARD_NAME.
*
* If @cancellable is not %NULL, then the operation can be cancelled
* by triggering the cancellable object from another thread. If the
@@ -1265,7 +1283,7 @@ g_file_query_file_type (GFile *file,
*
* For symlinks, normally the information about the target of the
* symlink is returned, rather than information about the symlink
- * itself. However if you pass #G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS
+ * itself. However if you pass %G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS
* in @flags the information about the symlink itself will be returned.
* Also, for symlinks that point to non-existing files the information
* about the symlink itself will be returned.
@@ -1275,7 +1293,7 @@ g_file_query_file_type (GFile *file,
* filesystem the file is on.
*
* Returns: (transfer full): a #GFileInfo for the given @file, or %NULL
- * on error. Free the returned object with g_object_unref().
+ * on error. Free the returned object with g_object_unref().
*/
GFileInfo *
g_file_query_info (GFile *file,
@@ -1311,9 +1329,9 @@ g_file_query_info (GFile *file,
* @flags: a set of #GFileQueryInfoFlags
* @io_priority: the [I/O priority][io-priority] of the request
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async): a #GAsyncReadyCallback to call when the
- * request is satisfied
+ * request is satisfied
* @user_data: (closure): the data to pass to callback function
*
* Asynchronously gets the requested information about specified @file.
@@ -1359,8 +1377,8 @@ g_file_query_info_async (GFile *file,
* See g_file_query_info_async().
*
* Returns: (transfer full): #GFileInfo for given @file
- * or %NULL on error. Free the returned object with
- * g_object_unref().
+ * or %NULL on error. Free the returned object with
+ * g_object_unref().
*/
GFileInfo *
g_file_query_info_finish (GFile *file,
@@ -1384,7 +1402,7 @@ g_file_query_info_finish (GFile *file,
* @file: input #GFile
* @attributes: an attribute query string
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError
*
* Similar to g_file_query_info(), but obtains information
@@ -1400,9 +1418,9 @@ g_file_query_info_finish (GFile *file,
* attributes, and a wildcard like "filesystem::*" means all attributes
* in the filesystem namespace. The standard namespace for filesystem
* attributes is "filesystem". Common attributes of interest are
- * #G_FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the filesystem
- * in bytes), #G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of bytes available),
- * and #G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
+ * %G_FILE_ATTRIBUTE_FILESYSTEM_SIZE (the total size of the filesystem
+ * in bytes), %G_FILE_ATTRIBUTE_FILESYSTEM_FREE (number of bytes available),
+ * and %G_FILE_ATTRIBUTE_FILESYSTEM_TYPE (type of the filesystem).
*
* If @cancellable is not %NULL, then the operation can be cancelled
* by triggering the cancellable object from another thread. If the
@@ -1414,7 +1432,7 @@ g_file_query_info_finish (GFile *file,
* kind of filesystem the file is on.
*
* Returns: (transfer full): a #GFileInfo or %NULL if there was an error.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*/
GFileInfo *
g_file_query_filesystem_info (GFile *file,
@@ -1448,9 +1466,9 @@ g_file_query_filesystem_info (GFile *file,
* @attributes: an attribute query string
* @io_priority: the [I/O priority][io-priority] of the request
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async): a #GAsyncReadyCallback to call
- * when the request is satisfied
+ * when the request is satisfied
* @user_data: (closure): the data to pass to callback function
*
* Asynchronously gets the requested information about the filesystem
@@ -1496,8 +1514,8 @@ g_file_query_filesystem_info_async (GFile *file,
* See g_file_query_filesystem_info_async().
*
* Returns: (transfer full): #GFileInfo for given @file
- * or %NULL on error.
- * Free the returned object with g_object_unref().
+ * or %NULL on error.
+ * Free the returned object with g_object_unref().
*/
GFileInfo *
g_file_query_filesystem_info_finish (GFile *file,
@@ -1520,7 +1538,7 @@ g_file_query_filesystem_info_finish (GFile *file,
* g_file_find_enclosing_mount:
* @file: input #GFile
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError
*
* Gets a #GMount for the #GFile.
@@ -1534,8 +1552,8 @@ g_file_query_filesystem_info_finish (GFile *file,
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
*
* Returns: (transfer full): a #GMount where the @file is located
- * or %NULL on error.
- * Free the returned object with g_object_unref().
+ * or %NULL on error.
+ * Free the returned object with g_object_unref().
*/
GMount *
g_file_find_enclosing_mount (GFile *file,
@@ -1570,9 +1588,9 @@ g_file_find_enclosing_mount (GFile *file,
* @file: a #GFile
* @io_priority: the [I/O priority][io-priority] of the request
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async): a #GAsyncReadyCallback to call
- * when the request is satisfied
+ * when the request is satisfied
* @user_data: (closure): the data to pass to callback function
*
* Asynchronously gets the mount for the file.
@@ -1613,7 +1631,7 @@ g_file_find_enclosing_mount_async (GFile *file,
* See g_file_find_enclosing_mount_async().
*
* Returns: (transfer full): #GMount for given @file or %NULL on error.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*/
GMount *
g_file_find_enclosing_mount_finish (GFile *file,
@@ -1653,7 +1671,7 @@ g_file_find_enclosing_mount_finish (GFile *file,
*
* Virtual: read_fn
* Returns: (transfer full): #GFileInputStream or %NULL on error.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*/
GFileInputStream *
g_file_read (GFile *file,
@@ -1685,14 +1703,14 @@ g_file_read (GFile *file,
* @file: input #GFile
* @flags: a set of #GFileCreateFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Gets an output stream for appending data to the file.
* If the file doesn't already exist it is created.
*
* By default files created are generally readable by everyone,
- * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
+ * but if you pass %G_FILE_CREATE_PRIVATE in @flags the file
* will be made readable only to the current user, to the level that
* is supported on the target filesystem.
*
@@ -1707,7 +1725,7 @@ g_file_read (GFile *file,
* possible too, and depend on what kind of filesystem the file is on.
*
* Returns: (transfer full): a #GFileOutputStream, or %NULL on error.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*/
GFileOutputStream *
g_file_append_to (GFile *file,
@@ -1740,14 +1758,14 @@ g_file_append_to (GFile *file,
* @file: input #GFile
* @flags: a set of #GFileCreateFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Creates a new file and returns an output stream for writing to it.
* The file must not already exist.
*
* By default files created are generally readable by everyone,
- * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
+ * but if you pass %G_FILE_CREATE_PRIVATE in @flags the file
* will be made readable only to the current user, to the level
* that is supported on the target filesystem.
*
@@ -1764,8 +1782,8 @@ g_file_append_to (GFile *file,
* of filesystem the file is on.
*
* Returns: (transfer full): a #GFileOutputStream for the newly created
- * file, or %NULL on error.
- * Free the returned object with g_object_unref().
+ * file, or %NULL on error.
+ * Free the returned object with g_object_unref().
*/
GFileOutputStream *
g_file_create (GFile *file,
@@ -1797,11 +1815,11 @@ g_file_create (GFile *file,
* g_file_replace:
* @file: input #GFile
* @etag: (nullable): an optional [entity tag][gfile-etag]
- * for the current #GFile, or #NULL to ignore
+ * for the current #GFile, or #NULL to ignore
* @make_backup: %TRUE if a backup should be created
* @flags: a set of #GFileCreateFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Returns an output stream for overwriting the file, possibly
@@ -1815,7 +1833,7 @@ g_file_create (GFile *file,
* the destination when the stream is closed.
*
* By default files created are generally readable by everyone,
- * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
+ * but if you pass %G_FILE_CREATE_PRIVATE in @flags the file
* will be made readable only to the current user, to the level that
* is supported on the target filesystem.
*
@@ -1847,7 +1865,7 @@ g_file_create (GFile *file,
* possible too, and depend on what kind of filesystem the file is on.
*
* Returns: (transfer full): a #GFileOutputStream or %NULL on error.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*/
GFileOutputStream *
g_file_replace (GFile *file,
@@ -1905,7 +1923,7 @@ g_file_replace (GFile *file,
* for reading or writing.
*
* Returns: (transfer full): #GFileIOStream or %NULL on error.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*
* Since: 2.22
*/
@@ -1939,14 +1957,14 @@ g_file_open_readwrite (GFile *file,
* @file: a #GFile
* @flags: a set of #GFileCreateFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: return location for a #GError, or %NULL
*
* Creates a new file and returns a stream for reading and
* writing to it. The file must not already exist.
*
* By default files created are generally readable by everyone,
- * but if you pass #G_FILE_CREATE_PRIVATE in @flags the file
+ * but if you pass %G_FILE_CREATE_PRIVATE in @flags the file
* will be made readable only to the current user, to the level
* that is supported on the target filesystem.
*
@@ -1967,8 +1985,8 @@ g_file_open_readwrite (GFile *file,
* streaming, rather than just opening for reading or writing.
*
* Returns: (transfer full): a #GFileIOStream for the newly created
- * file, or %NULL on error.
- * Free the returned object with g_object_unref().
+ * file, or %NULL on error.
+ * Free the returned object with g_object_unref().
*
* Since: 2.22
*/
@@ -2002,11 +2020,11 @@ g_file_create_readwrite (GFile *file,
* g_file_replace_readwrite:
* @file: a #GFile
* @etag: (nullable): an optional [entity tag][gfile-etag]
- * for the current #GFile, or #NULL to ignore
+ * for the current #GFile, or #NULL to ignore
* @make_backup: %TRUE if a backup should be created
* @flags: a set of #GFileCreateFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: return location for a #GError, or %NULL
*
* Returns an output stream for overwriting the file in readwrite mode,
@@ -2021,7 +2039,7 @@ g_file_create_readwrite (GFile *file,
* rather than just opening for reading or writing.
*
* Returns: (transfer full): a #GFileIOStream or %NULL on error.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*
* Since: 2.22
*/
@@ -2058,9 +2076,9 @@ g_file_replace_readwrite (GFile *file,
* @file: input #GFile
* @io_priority: the [I/O priority][io-priority] of the request
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async): a #GAsyncReadyCallback to call
- * when the request is satisfied
+ * when the request is satisfied
* @user_data: (closure): the data to pass to callback function
*
* Asynchronously opens @file for reading.
@@ -2101,7 +2119,7 @@ g_file_read_async (GFile *file,
* g_file_read_async().
*
* Returns: (transfer full): a #GFileInputStream or %NULL on error.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*/
GFileInputStream *
g_file_read_finish (GFile *file,
@@ -2126,9 +2144,9 @@ g_file_read_finish (GFile *file,
* @flags: a set of #GFileCreateFlags
* @io_priority: the [I/O priority][io-priority] of the request
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async): a #GAsyncReadyCallback to call
- * when the request is satisfied
+ * when the request is satisfied
* @user_data: (closure): the data to pass to callback function
*
* Asynchronously opens @file for appending.
@@ -2171,8 +2189,8 @@ g_file_append_to_async (GFile *file,
* g_file_append_to_async().
*
* Returns: (transfer full): a valid #GFileOutputStream
- * or %NULL on error.
- * Free the returned object with g_object_unref().
+ * or %NULL on error.
+ * Free the returned object with g_object_unref().
*/
GFileOutputStream *
g_file_append_to_finish (GFile *file,
@@ -2197,9 +2215,9 @@ g_file_append_to_finish (GFile *file,
* @flags: a set of #GFileCreateFlags
* @io_priority: the [I/O priority][io-priority] of the request
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async): a #GAsyncReadyCallback to call
- * when the request is satisfied
+ * when the request is satisfied
* @user_data: (closure): the data to pass to callback function
*
* Asynchronously creates a new file and returns an output stream
@@ -2243,7 +2261,7 @@ g_file_create_async (GFile *file,
* g_file_create_async().
*
* Returns: (transfer full): a #GFileOutputStream or %NULL on error.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*/
GFileOutputStream *
g_file_create_finish (GFile *file,
@@ -2266,14 +2284,14 @@ g_file_create_finish (GFile *file,
* g_file_replace_async:
* @file: input #GFile
* @etag: (nullable): an [entity tag][gfile-etag] for the current #GFile,
- * or %NULL to ignore
+ * or %NULL to ignore
* @make_backup: %TRUE if a backup should be created
* @flags: a set of #GFileCreateFlags
* @io_priority: the [I/O priority][io-priority] of the request
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async): a #GAsyncReadyCallback to call
- * when the request is satisfied
+ * when the request is satisfied
* @user_data: (closure): the data to pass to callback function
*
* Asynchronously overwrites the file, replacing the contents,
@@ -2321,7 +2339,7 @@ g_file_replace_async (GFile *file,
* g_file_replace_async().
*
* Returns: (transfer full): a #GFileOutputStream, or %NULL on error.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*/
GFileOutputStream *
g_file_replace_finish (GFile *file,
@@ -2345,9 +2363,9 @@ g_file_replace_finish (GFile *file,
* @file: input #GFile
* @io_priority: the [I/O priority][io-priority] of the request
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async): a #GAsyncReadyCallback to call
- * when the request is satisfied
+ * when the request is satisfied
* @user_data: (closure): the data to pass to callback function
*
* Asynchronously opens @file for reading and writing.
@@ -2390,7 +2408,7 @@ g_file_open_readwrite_async (GFile *file,
* g_file_open_readwrite_async().
*
* Returns: (transfer full): a #GFileIOStream or %NULL on error.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*
* Since: 2.22
*/
@@ -2417,9 +2435,9 @@ g_file_open_readwrite_finish (GFile *file,
* @flags: a set of #GFileCreateFlags
* @io_priority: the [I/O priority][io-priority] of the request
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async): a #GAsyncReadyCallback to call
- * when the request is satisfied
+ * when the request is satisfied
* @user_data: (closure): the data to pass to callback function
*
* Asynchronously creates a new file and returns a stream
@@ -2465,7 +2483,7 @@ g_file_create_readwrite_async (GFile *file,
* g_file_create_readwrite_async().
*
* Returns: (transfer full): a #GFileIOStream or %NULL on error.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*
* Since: 2.22
*/
@@ -2490,14 +2508,14 @@ g_file_create_readwrite_finish (GFile *file,
* g_file_replace_readwrite_async:
* @file: input #GFile
* @etag: (nullable): an [entity tag][gfile-etag] for the current #GFile,
- * or %NULL to ignore
+ * or %NULL to ignore
* @make_backup: %TRUE if a backup should be created
* @flags: a set of #GFileCreateFlags
* @io_priority: the [I/O priority][io-priority] of the request
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async): a #GAsyncReadyCallback to call
- * when the request is satisfied
+ * when the request is satisfied
* @user_data: (closure): the data to pass to callback function
*
* Asynchronously overwrites the file in read-write mode,
@@ -2548,7 +2566,7 @@ g_file_replace_readwrite_async (GFile *file,
* g_file_replace_readwrite_async().
*
* Returns: (transfer full): a #GFileIOStream, or %NULL on error.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*
* Since: 2.22
*/
@@ -2718,7 +2736,7 @@ should_copy (GFileAttributeInfo *info,
* @file: a #GFile to copy attributes to
* @flags: a set of #GFileCopyFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, %NULL to ignore
*
* Prepares the file attribute query string for copying to @file.
@@ -2732,7 +2750,7 @@ should_copy (GFileAttributeInfo *info,
* stages (e.g., for recursive move of a directory).
*
* Returns: an attribute query string for g_file_query_info(),
- * or %NULL if an error occurs.
+ * or %NULL if an error occurs.
*
* Since: 2.68
*/
@@ -2826,7 +2844,7 @@ g_file_build_attribute_list_for_copy (GFile *file,
* @destination: a #GFile to copy attributes to
* @flags: a set of #GFileCopyFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, %NULL to ignore
*
* Copies the file attributes from @source to @destination.
@@ -2834,12 +2852,12 @@ g_file_build_attribute_list_for_copy (GFile *file,
* Normally only a subset of the file attributes are copied,
* those that are copies in a normal file copy operation
* (which for instance does not include e.g. owner). However
- * if #G_FILE_COPY_ALL_METADATA is specified in @flags, then
+ * if %G_FILE_COPY_ALL_METADATA is specified in @flags, then
* all the metadata that is possible to copy is copied. This
* is useful when implementing move by copy + delete source.
*
* Returns: %TRUE if the attributes were copied successfully,
- * %FALSE otherwise.
+ * %FALSE otherwise.
*/
gboolean
g_file_copy_attributes (GFile *source,
@@ -3428,23 +3446,23 @@ file_copy_fallback (GFile *source,
* @destination: destination #GFile
* @flags: set of #GFileCopyFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @progress_callback: (nullable) (scope call): function to callback with
- * progress information, or %NULL if progress information is not needed
+ * progress information, or %NULL if progress information is not needed
* @progress_callback_data: (closure): user data to pass to @progress_callback
* @error: #GError to set on error, or %NULL
*
* Copies the file @source to the location specified by @destination.
* Can not handle recursive copies of directories.
*
- * If the flag #G_FILE_COPY_OVERWRITE is specified an already
+ * If the flag %G_FILE_COPY_OVERWRITE is specified an already
* existing @destination file is overwritten.
*
- * If the flag #G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
+ * If the flag %G_FILE_COPY_NOFOLLOW_SYMLINKS is specified then symlinks
* will be copied as symlinks, otherwise the target of the
* @source symlink will be copied.
*
- * If the flag #G_FILE_COPY_ALL_METADATA is specified then all the metadata
+ * If the flag %G_FILE_COPY_ALL_METADATA is specified then all the metadata
* that is possible to copy is copied, not just the default subset (which,
* for instance, does not include the owner, see #GFileInfo).
*
@@ -3461,7 +3479,7 @@ file_copy_fallback (GFile *source,
* If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND error
* is returned, independent on the status of the @destination.
*
- * If #G_FILE_COPY_OVERWRITE is not specified and the target exists, then
+ * If %G_FILE_COPY_OVERWRITE is not specified and the target exists, then
* the error %G_IO_ERROR_EXISTS is returned.
*
* If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
@@ -3469,7 +3487,7 @@ file_copy_fallback (GFile *source,
* %G_IO_ERROR_WOULD_MERGE error is returned.
*
* If the source is a directory and the target does not exist, or
- * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
+ * %G_FILE_COPY_OVERWRITE is specified and the target is a file, then the
* %G_IO_ERROR_WOULD_RECURSE error is returned.
*
* If you are interested in copying the #GFile object itself (not the on-disk
@@ -3557,9 +3575,9 @@ g_file_copy (GFile *source,
* @flags: set of #GFileCopyFlags
* @io_priority: the [I/O priority][io-priority] of the request
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @progress_callback: (nullable) (scope notified): function to callback with progress
- * information, or %NULL if progress information is not needed
+ * information, or %NULL if progress information is not needed
* @progress_callback_data: (closure progress_callback) (nullable): user data to pass to @progress_callback
* @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
* @user_data: (closure callback): the data to pass to callback function
@@ -3636,11 +3654,11 @@ g_file_copy_finish (GFile *file,
* @destination: #GFile pointing to the destination location
* @flags: set of #GFileCopyFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @progress_callback: (nullable) (scope call): #GFileProgressCallback
- * function for updates
+ * function for updates
* @progress_callback_data: (closure): gpointer to user data for
- * the callback function
+ * the callback function
* @error: #GError for returning error conditions, or %NULL
*
* Tries to move the file or directory @source to the location specified
@@ -3649,7 +3667,7 @@ g_file_copy_finish (GFile *file,
* implementation may support moving directories (for instance on moves
* inside the same filesystem), but the fallback code does not.
*
- * If the flag #G_FILE_COPY_OVERWRITE is specified an already
+ * If the flag %G_FILE_COPY_OVERWRITE is specified an already
* existing @destination file is overwritten.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
@@ -3665,7 +3683,7 @@ g_file_copy_finish (GFile *file,
* If the @source file does not exist, then the %G_IO_ERROR_NOT_FOUND
* error is returned, independent on the status of the @destination.
*
- * If #G_FILE_COPY_OVERWRITE is not specified and the target exists,
+ * If %G_FILE_COPY_OVERWRITE is not specified and the target exists,
* then the error %G_IO_ERROR_EXISTS is returned.
*
* If trying to overwrite a file over a directory, the %G_IO_ERROR_IS_DIRECTORY
@@ -3673,7 +3691,7 @@ g_file_copy_finish (GFile *file,
* %G_IO_ERROR_WOULD_MERGE error is returned.
*
* If the source is a directory and the target does not exist, or
- * #G_FILE_COPY_OVERWRITE is specified and the target is a file, then
+ * %G_FILE_COPY_OVERWRITE is specified and the target is a file, then
* the %G_IO_ERROR_WOULD_RECURSE error may be returned (if the native
* move operation isn't available).
*
@@ -3765,10 +3783,95 @@ g_file_move (GFile *source,
}
/**
+ * g_file_move_async:
+ * @source: #GFile pointing to the source location
+ * @destination: #GFile pointing to the destination location
+ * @flags: set of #GFileCopyFlags
+ * @io_priority: the [I/O priority][io-priority] of the request
+ * @cancellable: (nullable): optional #GCancellable object,
+ * %NULL to ignore
+ * @progress_callback: (nullable) (scope call): #GFileProgressCallback
+ * function for updates
+ * @progress_callback_data: (closure): gpointer to user data for
+ * the callback function
+ * @callback: a #GAsyncReadyCallback to call
+ * when the request is satisfied
+ * @user_data: the data to pass to callback function
+ *
+ * Asynchronously moves a file @source to the location of @destination. For details of the behaviour, see g_file_move().
+ *
+ * If @progress_callback is not %NULL, then that function that will be called
+ * just like in g_file_move(). The callback will run in the default main context
+ * of the thread calling g_file_move_async() — the same context as @callback is
+ * run in.
+ *
+ * When the operation is finished, @callback will be called. You can then call
+ * g_file_move_finish() to get the result of the operation.
+ *
+ * Since: 2.72
+ */
+void
+g_file_move_async (GFile *source,
+ GFile *destination,
+ GFileCopyFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GFileProgressCallback progress_callback,
+ gpointer progress_callback_data,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GFileIface *iface;
+
+ g_return_if_fail (G_IS_FILE (source));
+ g_return_if_fail (G_IS_FILE (destination));
+ g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
+
+ iface = G_FILE_GET_IFACE (source);
+ (* iface->move_async) (source,
+ destination,
+ flags,
+ io_priority,
+ cancellable,
+ progress_callback,
+ progress_callback_data,
+ callback,
+ user_data);
+}
+
+/**
+ * g_file_move_finish:
+ * @file: input source #GFile
+ * @result: a #GAsyncResult
+ * @error: a #GError, or %NULL
+ *
+ * Finishes an asynchronous file movement, started with
+ * g_file_move_async().
+ *
+ * Returns: %TRUE on successful file move, %FALSE otherwise.
+ *
+ * Since: 2.72
+ */
+gboolean
+g_file_move_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error)
+{
+ GFileIface *iface;
+
+ g_return_val_if_fail (G_IS_FILE (file), FALSE);
+ g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+ iface = G_FILE_GET_IFACE (file);
+ return (* iface->move_finish) (file, result, error);
+}
+
+/**
* g_file_make_directory:
* @file: input #GFile
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Creates a directory. Note that this will only create a child directory
@@ -3818,9 +3921,9 @@ g_file_make_directory (GFile *file,
* @file: input #GFile
* @io_priority: the [I/O priority][io-priority] of the request
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: a #GAsyncReadyCallback to call
- * when the request is satisfied
+ * when the request is satisfied
* @user_data: the data to pass to callback function
*
* Asynchronously creates a directory.
@@ -3878,7 +3981,7 @@ g_file_make_directory_finish (GFile *file,
* g_file_make_directory_with_parents:
* @file: input #GFile
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Creates a directory and any parent directories that may not
@@ -4000,9 +4103,9 @@ g_file_make_directory_with_parents (GFile *file,
* g_file_make_symbolic_link:
* @file: a #GFile with the name of the symlink to create
* @symlink_value: (type filename): a string with the path for the target
- * of the new symlink
+ * of the new symlink
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError
*
* Creates a symbolic link named @file which contains the string
@@ -4053,7 +4156,7 @@ g_file_make_symbolic_link (GFile *file,
* g_file_delete:
* @file: input #GFile
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Deletes a file. If the @file is a directory, it will only be
@@ -4111,9 +4214,9 @@ g_file_delete (GFile *file,
* @file: input #GFile
* @io_priority: the [I/O priority][io-priority] of the request
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: a #GAsyncReadyCallback to call
- * when the request is satisfied
+ * when the request is satisfied
* @user_data: the data to pass to callback function
*
* Asynchronously delete a file. If the @file is a directory, it will
@@ -4175,7 +4278,7 @@ g_file_delete_finish (GFile *file,
* g_file_trash:
* @file: #GFile to send to trash
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Sends @file to the "Trashcan", if possible. This is similar to
@@ -4222,9 +4325,9 @@ g_file_trash (GFile *file,
* @file: input #GFile
* @io_priority: the [I/O priority][io-priority] of the request
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: a #GAsyncReadyCallback to call
- * when the request is satisfied
+ * when the request is satisfied
* @user_data: the data to pass to callback function
*
* Asynchronously sends @file to the Trash location, if possible.
@@ -4283,7 +4386,7 @@ g_file_trash_finish (GFile *file,
* @file: input #GFile
* @display_name: a string
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Renames @file to the specified display name.
@@ -4292,7 +4395,7 @@ g_file_trash_finish (GFile *file,
* for the target filesystem if possible and the @file is renamed to this.
*
* If you want to implement a rename operation in the user interface the
- * edit name (#G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the
+ * edit name (%G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME) should be used as the
* initial value in the rename widget, and then the result after editing
* should be passed to g_file_set_display_name().
*
@@ -4303,8 +4406,8 @@ g_file_trash_finish (GFile *file,
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
*
* Returns: (transfer full): a #GFile specifying what @file was renamed to,
- * or %NULL if there was an error.
- * Free the returned object with g_object_unref().
+ * or %NULL if there was an error.
+ * Free the returned object with g_object_unref().
*/
GFile *
g_file_set_display_name (GFile *file,
@@ -4340,9 +4443,9 @@ g_file_set_display_name (GFile *file,
* @display_name: a string
* @io_priority: the [I/O priority][io-priority] of the request
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async): a #GAsyncReadyCallback to call
- * when the request is satisfied
+ * when the request is satisfied
* @user_data: (closure): the data to pass to callback function
*
* Asynchronously sets the display name for a given #GFile.
@@ -4386,7 +4489,7 @@ g_file_set_display_name_async (GFile *file,
* g_file_set_display_name_async().
*
* Returns: (transfer full): a #GFile or %NULL on error.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*/
GFile *
g_file_set_display_name_finish (GFile *file,
@@ -4409,7 +4512,7 @@ g_file_set_display_name_finish (GFile *file,
* g_file_query_settable_attributes:
* @file: input #GFile
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Obtain the list of settable attributes for the file.
@@ -4423,9 +4526,9 @@ g_file_set_display_name_finish (GFile *file,
* triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
*
- * Returns: a #GFileAttributeInfoList describing the settable attributes.
- * When you are done with it, release it with
- * g_file_attribute_info_list_unref()
+ * Returns: (transfer full): a #GFileAttributeInfoList describing the settable attributes.
+ * When you are done with it, release it with
+ * g_file_attribute_info_list_unref()
*/
GFileAttributeInfoList *
g_file_query_settable_attributes (GFile *file,
@@ -4467,7 +4570,7 @@ g_file_query_settable_attributes (GFile *file,
* g_file_query_writable_namespaces:
* @file: input #GFile
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Obtain the list of attribute namespaces where new attributes
@@ -4478,9 +4581,9 @@ g_file_query_settable_attributes (GFile *file,
* triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
*
- * Returns: a #GFileAttributeInfoList describing the writable namespaces.
- * When you are done with it, release it with
- * g_file_attribute_info_list_unref()
+ * Returns: (transfer full): a #GFileAttributeInfoList describing the writable namespaces.
+ * When you are done with it, release it with
+ * g_file_attribute_info_list_unref()
*/
GFileAttributeInfoList *
g_file_query_writable_namespaces (GFile *file,
@@ -4529,10 +4632,10 @@ g_file_query_writable_namespaces (GFile *file,
* @attribute: a string containing the attribute's name
* @type: The type of the attribute
* @value_p: (nullable): a pointer to the value (or the pointer
- * itself if the type is a pointer type)
+ * itself if the type is a pointer type)
* @flags: a set of #GFileQueryInfoFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Sets an attribute in the file with attribute name @attribute to @value_p.
@@ -4582,7 +4685,7 @@ g_file_set_attribute (GFile *file,
* @info: a #GFileInfo
* @flags: #GFileQueryInfoFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Tries to set all attributes in the #GFileInfo on the target
@@ -4674,7 +4777,7 @@ g_file_real_set_attributes_from_info (GFile *file,
* @flags: a #GFileQueryInfoFlags
* @io_priority: the [I/O priority][io-priority] of the request
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async): a #GAsyncReadyCallback
* @user_data: (closure): a #gpointer
*
@@ -4747,7 +4850,7 @@ g_file_set_attributes_finish (GFile *file,
* @value: a string containing the attribute's value
* @flags: #GFileQueryInfoFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
@@ -4779,7 +4882,7 @@ g_file_set_attribute_string (GFile *file,
* @value: a string containing the attribute's new value
* @flags: a #GFileQueryInfoFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
@@ -4791,7 +4894,7 @@ g_file_set_attribute_string (GFile *file,
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
*
* Returns: %TRUE if the @attribute was successfully set to @value
- * in the @file, %FALSE otherwise.
+ * in the @file, %FALSE otherwise.
*/
gboolean
g_file_set_attribute_byte_string (GFile *file,
@@ -4813,7 +4916,7 @@ g_file_set_attribute_byte_string (GFile *file,
* @value: a #guint32 containing the attribute's new value
* @flags: a #GFileQueryInfoFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
@@ -4824,7 +4927,7 @@ g_file_set_attribute_byte_string (GFile *file,
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
*
* Returns: %TRUE if the @attribute was successfully set to @value
- * in the @file, %FALSE otherwise.
+ * in the @file, %FALSE otherwise.
*/
gboolean
g_file_set_attribute_uint32 (GFile *file,
@@ -4846,7 +4949,7 @@ g_file_set_attribute_uint32 (GFile *file,
* @value: a #gint32 containing the attribute's new value
* @flags: a #GFileQueryInfoFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
@@ -4857,7 +4960,7 @@ g_file_set_attribute_uint32 (GFile *file,
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
*
* Returns: %TRUE if the @attribute was successfully set to @value
- * in the @file, %FALSE otherwise.
+ * in the @file, %FALSE otherwise.
*/
gboolean
g_file_set_attribute_int32 (GFile *file,
@@ -4879,7 +4982,7 @@ g_file_set_attribute_int32 (GFile *file,
* @value: a #guint64 containing the attribute's new value
* @flags: a #GFileQueryInfoFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
@@ -4890,7 +4993,7 @@ g_file_set_attribute_int32 (GFile *file,
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
*
* Returns: %TRUE if the @attribute was successfully set to @value
- * in the @file, %FALSE otherwise.
+ * in the @file, %FALSE otherwise.
*/
gboolean
g_file_set_attribute_uint64 (GFile *file,
@@ -4912,7 +5015,7 @@ g_file_set_attribute_uint64 (GFile *file,
* @value: a #guint64 containing the attribute's new value
* @flags: a #GFileQueryInfoFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
@@ -4942,11 +5045,11 @@ g_file_set_attribute_int64 (GFile *file,
* @file: input #GFile
* @flags: flags affecting the operation
* @mount_operation: (nullable): a #GMountOperation,
- * or %NULL to avoid user interaction
+ * or %NULL to avoid user interaction
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async) (nullable): a #GAsyncReadyCallback to call
- * when the request is satisfied, or %NULL
+ * when the request is satisfied, or %NULL
* @user_data: (closure): the data to pass to callback function
*
* Mounts a file of type G_FILE_TYPE_MOUNTABLE.
@@ -5004,7 +5107,7 @@ g_file_mount_mountable (GFile *file,
* with g_file_mount_mountable().
*
* Returns: (transfer full): a #GFile or %NULL on error.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*/
GFile *
g_file_mount_mountable_finish (GFile *file,
@@ -5030,9 +5133,9 @@ g_file_mount_mountable_finish (GFile *file,
* @file: input #GFile
* @flags: flags affecting the operation
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async) (nullable): a #GAsyncReadyCallback to call
- * when the request is satisfied, or %NULL
+ * when the request is satisfied, or %NULL
* @user_data: (closure): the data to pass to callback function
*
* Unmounts a file of type G_FILE_TYPE_MOUNTABLE.
@@ -5088,10 +5191,10 @@ g_file_unmount_mountable (GFile *file,
* with g_file_unmount_mountable().
*
* Returns: %TRUE if the operation finished successfully.
- * %FALSE otherwise.
+ * %FALSE otherwise.
*
* Deprecated: 2.22: Use g_file_unmount_mountable_with_operation_finish()
- * instead.
+ * instead.
*/
gboolean
g_file_unmount_mountable_finish (GFile *file,
@@ -5117,14 +5220,14 @@ g_file_unmount_mountable_finish (GFile *file,
* @file: input #GFile
* @flags: flags affecting the operation
* @mount_operation: (nullable): a #GMountOperation,
- * or %NULL to avoid user interaction
+ * or %NULL to avoid user interaction
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async) (nullable): a #GAsyncReadyCallback to call
- * when the request is satisfied, or %NULL
+ * when the request is satisfied, or %NULL
* @user_data: (closure): the data to pass to callback function
*
- * Unmounts a file of type #G_FILE_TYPE_MOUNTABLE.
+ * Unmounts a file of type %G_FILE_TYPE_MOUNTABLE.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
@@ -5187,7 +5290,7 @@ g_file_unmount_mountable_with_operation (GFile *file,
* with g_file_unmount_mountable_with_operation().
*
* Returns: %TRUE if the operation finished successfully.
- * %FALSE otherwise.
+ * %FALSE otherwise.
*
* Since: 2.22
*/
@@ -5218,9 +5321,9 @@ g_file_unmount_mountable_with_operation_finish (GFile *file,
* @file: input #GFile
* @flags: flags affecting the operation
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async) (nullable): a #GAsyncReadyCallback to call
- * when the request is satisfied, or %NULL
+ * when the request is satisfied, or %NULL
* @user_data: (closure): the data to pass to callback function
*
* Starts an asynchronous eject on a mountable.
@@ -5273,10 +5376,10 @@ g_file_eject_mountable (GFile *file,
* g_file_eject_mountable().
*
* Returns: %TRUE if the @file was ejected successfully.
- * %FALSE otherwise.
+ * %FALSE otherwise.
*
* Deprecated: 2.22: Use g_file_eject_mountable_with_operation_finish()
- * instead.
+ * instead.
*/
gboolean
g_file_eject_mountable_finish (GFile *file,
@@ -5302,11 +5405,11 @@ g_file_eject_mountable_finish (GFile *file,
* @file: input #GFile
* @flags: flags affecting the operation
* @mount_operation: (nullable): a #GMountOperation,
- * or %NULL to avoid user interaction
+ * or %NULL to avoid user interaction
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (scope async) (nullable): a #GAsyncReadyCallback to call
- * when the request is satisfied, or %NULL
+ * when the request is satisfied, or %NULL
* @user_data: (closure): the data to pass to callback function
*
* Starts an asynchronous eject on a mountable.
@@ -5368,7 +5471,7 @@ g_file_eject_mountable_with_operation (GFile *file,
* g_file_eject_mountable_with_operation().
*
* Returns: %TRUE if the @file was ejected successfully.
- * %FALSE otherwise.
+ * %FALSE otherwise.
*
* Since: 2.22
*/
@@ -5399,7 +5502,7 @@ g_file_eject_mountable_with_operation_finish (GFile *file,
* @file: input #GFile
* @flags: a set of #GFileMonitorFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Obtains a directory monitor for the given file.
@@ -5417,8 +5520,8 @@ g_file_eject_mountable_with_operation_finish (GFile *file,
*
* Virtual: monitor_dir
* Returns: (transfer full): a #GFileMonitor for the given @file,
- * or %NULL on error.
- * Free the returned object with g_object_unref().
+ * or %NULL on error.
+ * Free the returned object with g_object_unref().
*/
GFileMonitor *
g_file_monitor_directory (GFile *file,
@@ -5452,7 +5555,7 @@ g_file_monitor_directory (GFile *file,
* @file: input #GFile
* @flags: a set of #GFileMonitorFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Obtains a file monitor for the given file. If no file notification
@@ -5471,8 +5574,8 @@ g_file_monitor_directory (GFile *file,
* backend and/or filesystem type.
*
* Returns: (transfer full): a #GFileMonitor for the given @file,
- * or %NULL on error.
- * Free the returned object with g_object_unref().
+ * or %NULL on error.
+ * Free the returned object with g_object_unref().
*/
GFileMonitor *
g_file_monitor_file (GFile *file,
@@ -5507,7 +5610,7 @@ g_file_monitor_file (GFile *file,
* @file: input #GFile
* @flags: a set of #GFileMonitorFlags
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @error: a #GError, or %NULL
*
* Obtains a file or directory monitor for the given file,
@@ -5518,8 +5621,8 @@ g_file_monitor_file (GFile *file,
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
*
* Returns: (transfer full): a #GFileMonitor for the given @file,
- * or %NULL on error.
- * Free the returned object with g_object_unref().
+ * or %NULL on error.
+ * Free the returned object with g_object_unref().
*
* Since: 2.18
*/
@@ -5998,6 +6101,125 @@ g_file_real_trash_finish (GFile *file,
return g_task_propagate_boolean (G_TASK (res), error);
}
+
+typedef struct {
+ GFile *source; /* (owned) */
+ GFile *destination; /* (owned) */
+ GFileCopyFlags flags;
+ GFileProgressCallback progress_cb;
+ gpointer progress_cb_data;
+} MoveAsyncData;
+
+static void
+move_async_data_free (MoveAsyncData *data)
+{
+ g_object_unref (data->source);
+ g_object_unref (data->destination);
+ g_slice_free (MoveAsyncData, data);
+}
+
+typedef struct {
+ MoveAsyncData *data; /* (unowned) */
+ goffset current_num_bytes;
+ goffset total_num_bytes;
+} MoveProgressData;
+
+static gboolean
+move_async_progress_in_main (gpointer user_data)
+{
+ MoveProgressData *progress = user_data;
+ MoveAsyncData *data = progress->data;
+
+ data->progress_cb (progress->current_num_bytes,
+ progress->total_num_bytes,
+ data->progress_cb_data);
+
+ return G_SOURCE_REMOVE;
+}
+
+static void
+move_async_progress_callback (goffset current_num_bytes,
+ goffset total_num_bytes,
+ gpointer user_data)
+{
+ GTask *task = user_data;
+ MoveAsyncData *data = g_task_get_task_data (task);
+ MoveProgressData *progress;
+
+ progress = g_new0 (MoveProgressData, 1);
+ progress->data = data;
+ progress->current_num_bytes = current_num_bytes;
+ progress->total_num_bytes = total_num_bytes;
+
+ g_main_context_invoke_full (g_task_get_context (task),
+ g_task_get_priority (task),
+ move_async_progress_in_main,
+ g_steal_pointer (&progress),
+ g_free);
+}
+
+static void
+move_async_thread (GTask *task,
+ gpointer source,
+ gpointer task_data,
+ GCancellable *cancellable)
+{
+ MoveAsyncData *data = task_data;
+ gboolean result;
+ GError *error = NULL;
+
+ result = g_file_move (data->source,
+ data->destination,
+ data->flags,
+ cancellable,
+ (data->progress_cb != NULL) ? move_async_progress_callback : NULL,
+ task,
+ &error);
+ if (result)
+ g_task_return_boolean (task, TRUE);
+ else
+ g_task_return_error (task, g_steal_pointer (&error));
+}
+
+static void
+g_file_real_move_async (GFile *source,
+ GFile *destination,
+ GFileCopyFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GFileProgressCallback progress_callback,
+ gpointer progress_callback_data,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GTask *task;
+ MoveAsyncData *data;
+
+ data = g_slice_new0 (MoveAsyncData);
+ data->source = g_object_ref (source);
+ data->destination = g_object_ref (destination);
+ data->flags = flags;
+ data->progress_cb = progress_callback;
+ data->progress_cb_data = progress_callback_data;
+
+ task = g_task_new (source, cancellable, callback, user_data);
+ g_task_set_source_tag (task, g_file_real_move_async);
+ g_task_set_task_data (task, g_steal_pointer (&data), (GDestroyNotify) move_async_data_free);
+ g_task_set_priority (task, io_priority);
+ g_task_run_in_thread (task, move_async_thread);
+ g_object_unref (task);
+}
+
+static gboolean
+g_file_real_move_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error)
+{
+ g_return_val_if_fail (g_task_is_valid (result, file), FALSE);
+
+ return g_task_propagate_boolean (G_TASK (result), error);
+}
+
static void
make_directory_async_thread (GTask *task,
gpointer object,
@@ -6397,12 +6619,12 @@ typedef struct {
CopyAsyncData *data;
goffset current_num_bytes;
goffset total_num_bytes;
-} ProgressData;
+} CopyProgressData;
static gboolean
copy_async_progress_in_main (gpointer user_data)
{
- ProgressData *progress = user_data;
+ CopyProgressData *progress = user_data;
CopyAsyncData *data = progress->data;
data->progress_cb (progress->current_num_bytes,
@@ -6419,9 +6641,9 @@ copy_async_progress_callback (goffset current_num_bytes,
{
GTask *task = user_data;
CopyAsyncData *data = g_task_get_task_data (task);
- ProgressData *progress;
+ CopyProgressData *progress;
- progress = g_new (ProgressData, 1);
+ progress = g_new (CopyProgressData, 1);
progress->data = data;
progress->current_num_bytes = current_num_bytes;
progress->total_num_bytes = total_num_bytes;
@@ -6503,7 +6725,7 @@ g_file_real_copy_finish (GFile *file,
/**
* g_file_new_for_path:
* @path: (type filename): a string containing a relative or absolute path.
- * The string must be encoded in the glib filename encoding.
+ * The string must be encoded in the glib filename encoding.
*
* Constructs a #GFile for a given path. This operation never
* fails, but the returned object might not support any I/O
@@ -6530,7 +6752,7 @@ g_file_new_for_path (const char *path)
* not supported.
*
* Returns: (transfer full): a new #GFile for the given @uri.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*/
GFile *
g_file_new_for_uri (const char *uri)
@@ -6559,7 +6781,7 @@ g_file_new_for_uri (const char *uri)
* a temporary file could not be created.
*
* Returns: (transfer full): a new #GFile.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*
* Since: 2.32
*/
@@ -6720,7 +6942,7 @@ new_for_cmdline_arg (const gchar *arg,
* #GOptionContext arguments of type %G_OPTION_ARG_FILENAME.
*
* Returns: (transfer full): a new #GFile.
- * Free the returned object with g_object_unref().
+ * Free the returned object with g_object_unref().
*/
GFile *
g_file_new_for_commandline_arg (const char *arg)
@@ -6766,11 +6988,11 @@ g_file_new_for_commandline_arg_and_cwd (const gchar *arg,
* @location: input #GFile
* @flags: flags affecting the operation
* @mount_operation: (nullable): a #GMountOperation
- * or %NULL to avoid user interaction
+ * or %NULL to avoid user interaction
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (nullable): a #GAsyncReadyCallback to call
- * when the request is satisfied, or %NULL
+ * when the request is satisfied, or %NULL
* @user_data: the data to pass to callback function
*
* Starts a @mount_operation, mounting the volume that contains
@@ -6820,8 +7042,8 @@ g_file_mount_enclosing_volume (GFile *location,
* Finishes a mount operation started by g_file_mount_enclosing_volume().
*
* Returns: %TRUE if successful. If an error has occurred,
- * this function will return %FALSE and set @error
- * appropriately if present.
+ * this function will return %FALSE and set @error
+ * appropriately if present.
*/
gboolean
g_file_mount_enclosing_volume_finish (GFile *location,
@@ -6861,8 +7083,8 @@ g_file_mount_enclosing_volume_finish (GFile *location,
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
*
* Returns: (transfer full): a #GAppInfo if the handle was found,
- * %NULL if there were errors.
- * When you are done with it, release it with g_object_unref()
+ * %NULL if there were errors.
+ * When you are done with it, release it with g_object_unref()
*/
GAppInfo *
g_file_query_default_handler (GFile *file,
@@ -7032,8 +7254,8 @@ g_file_query_default_handler_async (GFile *file,
* Finishes a g_file_query_default_handler_async() operation.
*
* Returns: (transfer full): a #GAppInfo if the handle was found,
- * %NULL if there were errors.
- * When you are done with it, release it with g_object_unref()
+ * %NULL if there were errors.
+ * When you are done with it, release it with g_object_unref()
*
* Since: 2.60
*/
@@ -7056,9 +7278,9 @@ g_file_query_default_handler_finish (GFile *file,
* @cancellable: optional #GCancellable object, %NULL to ignore
* @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
* @length: (out) (optional): a location to place the length of the contents of the file,
- * or %NULL if the length is not needed
+ * or %NULL if the length is not needed
* @etag_out: (out) (optional) (nullable): a location to place the current entity tag for the file,
- * or %NULL if the entity tag is not needed
+ * or %NULL if the entity tag is not needed
* @error: a #GError, or %NULL
*
* Loads the content of the file into memory. The data is always
@@ -7071,7 +7293,7 @@ g_file_query_default_handler_finish (GFile *file,
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
*
* Returns: %TRUE if the @file's contents were successfully loaded.
- * %FALSE if there were errors.
+ * %FALSE if there were errors.
*/
gboolean
g_file_load_contents (GFile *file,
@@ -7294,10 +7516,10 @@ load_contents_open_callback (GObject *obj,
* @file: input #GFile
* @cancellable: optional #GCancellable object, %NULL to ignore
* @read_more_callback: (scope call) (closure user_data): a
- * #GFileReadMoreCallback to receive partial data
- * and to specify whether further data should be read
+ * #GFileReadMoreCallback to receive partial data
+ * and to specify whether further data should be read
* @callback: (scope async) (closure user_data): a #GAsyncReadyCallback to call
- * when the request is satisfied
+ * when the request is satisfied
* @user_data: the data to pass to the callback functions
*
* Reads the partial contents of a file. A #GFileReadMoreCallback should
@@ -7344,9 +7566,9 @@ g_file_load_partial_contents_async (GFile *file,
* @res: a #GAsyncResult
* @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
* @length: (out) (optional): a location to place the length of the contents of the file,
- * or %NULL if the length is not needed
+ * or %NULL if the length is not needed
* @etag_out: (out) (optional) (nullable): a location to place the current entity tag for the file,
- * or %NULL if the entity tag is not needed
+ * or %NULL if the entity tag is not needed
* @error: a #GError, or %NULL
*
* Finishes an asynchronous partial load operation that was started
@@ -7356,7 +7578,7 @@ g_file_load_partial_contents_async (GFile *file,
* needed.
*
* Returns: %TRUE if the load was successful. If %FALSE and @error is
- * present, it will be set appropriately.
+ * present, it will be set appropriately.
*/
gboolean
g_file_load_partial_contents_finish (GFile *file,
@@ -7442,9 +7664,9 @@ g_file_load_contents_async (GFile *file,
* @res: a #GAsyncResult
* @contents: (out) (transfer full) (element-type guint8) (array length=length): a location to place the contents of the file
* @length: (out) (optional): a location to place the length of the contents of the file,
- * or %NULL if the length is not needed
+ * or %NULL if the length is not needed
* @etag_out: (out) (optional) (nullable): a location to place the current entity tag for the file,
- * or %NULL if the entity tag is not needed
+ * or %NULL if the entity tag is not needed
* @error: a #GError, or %NULL
*
* Finishes an asynchronous load of the @file's contents.
@@ -7454,7 +7676,7 @@ g_file_load_contents_async (GFile *file,
* set to the new entity tag for the @file.
*
* Returns: %TRUE if the load was successful. If %FALSE and @error is
- * present, it will be set appropriately.
+ * present, it will be set appropriately.
*/
gboolean
g_file_load_contents_finish (GFile *file,
@@ -7478,12 +7700,12 @@ g_file_load_contents_finish (GFile *file,
* @contents: (element-type guint8) (array length=length): a string containing the new contents for @file
* @length: the length of @contents in bytes
* @etag: (nullable): the old [entity-tag][gfile-etag] for the document,
- * or %NULL
+ * or %NULL
* @make_backup: %TRUE if a backup should be created
* @flags: a set of #GFileCreateFlags
* @new_etag: (out) (optional) (nullable): a location to a new [entity tag][gfile-etag]
- * for the document. This should be freed with g_free() when no longer
- * needed, or %NULL
+ * for the document. This should be freed with g_free() when no longer
+ * needed, or %NULL
* @cancellable: optional #GCancellable object, %NULL to ignore
* @error: a #GError, or %NULL
*
@@ -7505,7 +7727,7 @@ g_file_load_contents_finish (GFile *file,
* changed the next time it is saved over.
*
* Returns: %TRUE if successful. If an error has occurred, this function
- * will return %FALSE and set @error appropriately if present.
+ * will return %FALSE and set @error appropriately if present.
*/
gboolean
g_file_replace_contents (GFile *file,
@@ -7790,8 +8012,8 @@ g_file_replace_contents_bytes_async (GFile *file,
* @file: input #GFile
* @res: a #GAsyncResult
* @new_etag: (out) (optional) (nullable): a location of a new [entity tag][gfile-etag]
- * for the document. This should be freed with g_free() when it is no
- * longer needed, or %NULL
+ * for the document. This should be freed with g_free() when it is no
+ * longer needed, or %NULL
* @error: a #GError, or %NULL
*
* Finishes an asynchronous replace of the given @file. See
@@ -8015,7 +8237,7 @@ g_file_real_measure_disk_usage_finish (GFile *file,
* callback will be invoked.
*
* Returns: %TRUE if successful, with the out parameters set.
- * %FALSE otherwise, with @error set.
+ * %FALSE otherwise, with @error set.
*
* Since: 2.38
**/
@@ -8090,7 +8312,7 @@ g_file_measure_disk_usage_async (GFile *file,
* more information.
*
* Returns: %TRUE if successful, with the out parameters set.
- * %FALSE otherwise, with @error set.
+ * %FALSE otherwise, with @error set.
*
* Since: 2.38
**/
@@ -8117,7 +8339,7 @@ g_file_measure_disk_usage_finish (GFile *file,
* @callback: (nullable): a #GAsyncReadyCallback to call when the request is satisfied, or %NULL
* @user_data: the data to pass to callback function
*
- * Starts a file of type #G_FILE_TYPE_MOUNTABLE.
+ * Starts a file of type %G_FILE_TYPE_MOUNTABLE.
* Using @start_operation, you can request callbacks when, for instance,
* passwords are needed during authentication.
*
@@ -8202,14 +8424,14 @@ g_file_start_mountable_finish (GFile *file,
* @file: input #GFile
* @flags: flags affecting the operation
* @mount_operation: (nullable): a #GMountOperation,
- * or %NULL to avoid user interaction.
+ * or %NULL to avoid user interaction.
* @cancellable: (nullable): optional #GCancellable object,
- * %NULL to ignore
+ * %NULL to ignore
* @callback: (nullable): a #GAsyncReadyCallback to call
- * when the request is satisfied, or %NULL
+ * when the request is satisfied, or %NULL
* @user_data: the data to pass to callback function
*
- * Stops a file of type #G_FILE_TYPE_MOUNTABLE.
+ * Stops a file of type %G_FILE_TYPE_MOUNTABLE.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
@@ -8264,7 +8486,7 @@ g_file_stop_mountable (GFile *file,
* with g_file_stop_mountable().
*
* Returns: %TRUE if the operation finished successfully.
- * %FALSE otherwise.
+ * %FALSE otherwise.
*
* Since: 2.22
*/
@@ -8292,10 +8514,10 @@ g_file_stop_mountable_finish (GFile *file,
* @file: input #GFile
* @cancellable: optional #GCancellable object, %NULL to ignore
* @callback: (nullable): a #GAsyncReadyCallback to call
- * when the request is satisfied, or %NULL
+ * when the request is satisfied, or %NULL
* @user_data: the data to pass to callback function
*
- * Polls a file of type #G_FILE_TYPE_MOUNTABLE.
+ * Polls a file of type %G_FILE_TYPE_MOUNTABLE.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
@@ -8398,7 +8620,7 @@ g_file_supports_thread_contexts (GFile *file)
* @file: a #GFile
* @cancellable: (nullable): a #GCancellable or %NULL
* @etag_out: (out) (nullable) (optional): a location to place the current
- * entity tag for the file, or %NULL if the entity tag is not needed
+ * entity tag for the file, or %NULL if the entity tag is not needed
* @error: a location for a #GError or %NULL
*
* Loads the contents of @file and returns it as #GBytes.
@@ -8485,7 +8707,7 @@ g_file_load_bytes_cb (GObject *object,
* @file: a #GFile
* @cancellable: (nullable): a #GCancellable or %NULL
* @callback: (scope async): a #GAsyncReadyCallback to call when the
- * request is satisfied
+ * request is satisfied
* @user_data: (closure): the data to pass to callback function
*
* Asynchronously loads the contents of @file as #GBytes.
@@ -8543,7 +8765,7 @@ g_file_load_bytes_async (GFile *file,
* @file: a #GFile
* @result: a #GAsyncResult provided to the callback
* @etag_out: (out) (nullable) (optional): a location to place the current
- * entity tag for the file, or %NULL if the entity tag is not needed
+ * entity tag for the file, or %NULL if the entity tag is not needed
* @error: a location for a #GError, or %NULL
*
* Completes an asynchronous request to g_file_load_bytes_async().