Merge branch 'fix-issue-3210' into 'main'

GWinHttpFile: Add support for G_FILE_ATTRIBUTE_STANDARD_TYPE

Closes #3210

See merge request GNOME/glib!3908
This commit is contained in:
Philip Withnall 2024-02-14 09:22:36 +00:00
commit 43924f7cf5
2 changed files with 17 additions and 0 deletions

View File

@ -3378,10 +3378,24 @@ file_copy_fallback (GFile *source,
if (!info) if (!info)
goto out; goto out;
if (!g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_TYPE))
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Cannot retrieve attribute %s"), G_FILE_ATTRIBUTE_STANDARD_TYPE);
goto out;
}
/* Maybe copy the symlink? */ /* Maybe copy the symlink? */
if ((flags & G_FILE_COPY_NOFOLLOW_SYMLINKS) && if ((flags & G_FILE_COPY_NOFOLLOW_SYMLINKS) &&
g_file_info_get_file_type (info) == G_FILE_TYPE_SYMBOLIC_LINK) g_file_info_get_file_type (info) == G_FILE_TYPE_SYMBOLIC_LINK)
{ {
if (!g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET))
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Cannot retrieve attribute %s"), G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET);
goto out;
}
target = g_file_info_get_symlink_target (info); target = g_file_info_get_symlink_target (info);
if (target) if (target)
{ {

View File

@ -537,6 +537,9 @@ g_winhttp_file_query_info (GFile *file,
g_free (display_name); g_free (display_name);
} }
if (_g_file_attribute_matcher_matches_id (matcher, G_FILE_ATTRIBUTE_ID_STANDARD_TYPE))
g_file_info_set_file_type (info, G_FILE_TYPE_REGULAR);
content_length = NULL; content_length = NULL;
if (_g_winhttp_query_header (winhttp_file->vfs, if (_g_winhttp_query_header (winhttp_file->vfs,
request, request,