tests: Fix gio API usage

Related: glib!3261
This commit is contained in:
Benjamin Otte 2024-01-16 06:22:43 +01:00
parent 771ea81715
commit 70f0cde730
2 changed files with 11 additions and 2 deletions

View File

@ -119,10 +119,15 @@ row_data_update_info (RowData *data,
icon = g_file_icon_new (thumbnail_file);
g_object_unref (thumbnail_file);
}
else
else if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_ICON))
{
icon = g_file_info_get_icon (info);
}
else
{
icon = NULL;
}
gtk_widget_set_visible (data->icon, icon != NULL);
gtk_image_set_from_gicon (GTK_IMAGE (data->icon), icon);

View File

@ -376,10 +376,14 @@ row_data_update_info (RowData *data,
icon = g_file_icon_new (thumbnail_file);
g_object_unref (thumbnail_file);
}
else
else if (g_file_info_has_attribute (info, G_FILE_ATTRIBUTE_STANDARD_ICON))
{
icon = g_file_info_get_icon (info);
}
else
{
icon = NULL;
}
gtk_widget_set_visible (data->icon, icon != NULL);
gtk_image_set_from_gicon (GTK_IMAGE (data->icon), icon);