mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 07:56:17 +01:00
gfile: Use g_error_matches
Make proper use of g_error_matches() instead of comparing only error codes. https://bugzilla.gnome.org/show_bug.cgi?id=719455
This commit is contained in:
parent
5a7db3015a
commit
44372f4dd0
@ -3758,7 +3758,7 @@ g_file_make_directory_with_parents (GFile *file,
|
||||
return FALSE;
|
||||
|
||||
g_file_make_directory (file, cancellable, &my_error);
|
||||
if (my_error == NULL || my_error->code != G_IO_ERROR_NOT_FOUND)
|
||||
if (!g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
|
||||
{
|
||||
if (my_error)
|
||||
g_propagate_error (error, my_error);
|
||||
@ -3767,7 +3767,7 @@ g_file_make_directory_with_parents (GFile *file,
|
||||
|
||||
work_file = g_object_ref (file);
|
||||
|
||||
while (my_error != NULL && my_error->code == G_IO_ERROR_NOT_FOUND)
|
||||
while (g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
|
||||
{
|
||||
GFile *parent_file;
|
||||
|
||||
@ -3786,7 +3786,7 @@ g_file_make_directory_with_parents (GFile *file,
|
||||
g_object_unref (work_file);
|
||||
work_file = g_object_ref (parent_file);
|
||||
|
||||
if (my_error != NULL && my_error->code == G_IO_ERROR_NOT_FOUND)
|
||||
if (g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
|
||||
list = g_list_prepend (list, parent_file); /* Transfer ownership of ref */
|
||||
else
|
||||
g_object_unref (parent_file);
|
||||
|
Loading…
Reference in New Issue
Block a user