filechooserutils: Add helper to get GFile from info

This will be used extensively starting from next commit!
This commit is contained in:
Georges Basile Stavracas Neto 2022-10-09 17:41:33 -03:00 committed by Matthias Clasen
parent c8d291ab86
commit b26222b6ba
2 changed files with 11 additions and 0 deletions

View File

@ -479,3 +479,12 @@ _gtk_file_info_get_icon (GFileInfo *info,
icon = g_themed_icon_new ("text-x-generic");
return icon;
}
GFile *
_gtk_file_info_get_file (GFileInfo *info)
{
g_assert (G_IS_FILE_INFO (info));
g_assert (g_file_info_has_attribute (info, "standard::file"));
return G_FILE (g_file_info_get_attribute_object (info, "standard::file"));
}

View File

@ -58,6 +58,8 @@ GIcon * _gtk_file_info_get_icon (GFileInfo *info,
int scale,
GtkIconTheme *icon_theme);
GFile * _gtk_file_info_get_file (GFileInfo *info);
G_END_DECLS
#endif /* __GTK_FILE_CHOOSER_UTILS_H__ */