icontheme: Stop exporting gtk_icon_info_new_for_file

This commit is contained in:
Timm Bäder 2018-10-30 16:31:09 +01:00
parent 0c017ff109
commit 797739198f
2 changed files with 33 additions and 38 deletions

View File

@ -4710,6 +4710,39 @@ gtk_icon_theme_lookup_by_gicon (GtkIconTheme *icon_theme,
size, 1, flags);
}
static GtkIconInfo *
gtk_icon_info_new_for_file (GFile *file,
gint size,
gint scale)
{
GtkIconInfo *info;
info = icon_info_new (ICON_THEME_DIR_UNTHEMED, size, 1);
info->loadable = G_LOADABLE_ICON (g_file_icon_new (file));
info->icon_file = g_object_ref (file);
info->is_resource = g_file_has_uri_scheme (file, "resource");
if (info->is_resource)
{
gchar *uri;
uri = g_file_get_uri (file);
info->filename = g_strdup (uri + 11); /* resource:// */
g_free (uri);
}
else
{
info->filename = g_file_get_path (file);
}
info->is_svg = suffix_from_name (info->filename) == ICON_SUFFIX_SVG;
info->desired_size = size;
info->desired_scale = scale;
info->forced_size = FALSE;
return info;
}
/**
* gtk_icon_theme_lookup_by_gicon_for_scale:
@ -4830,37 +4863,3 @@ gtk_icon_info_new_for_pixbuf (GtkIconTheme *icon_theme,
return info;
}
GtkIconInfo *
gtk_icon_info_new_for_file (GFile *file,
gint size,
gint scale)
{
GtkIconInfo *info;
info = icon_info_new (ICON_THEME_DIR_UNTHEMED, size, 1);
info->loadable = G_LOADABLE_ICON (g_file_icon_new (file));
info->icon_file = g_object_ref (file);
info->is_resource = g_file_has_uri_scheme (file, "resource");
if (info->is_resource)
{
gchar *uri;
uri = g_file_get_uri (file);
info->filename = g_strdup (uri + 11); /* resource:// */
g_free (uri);
}
else
{
info->filename = g_file_get_path (file);
}
info->is_svg = suffix_from_name (info->filename) == ICON_SUFFIX_SVG;
info->desired_size = size;
info->desired_scale = scale;
info->forced_size = FALSE;
return info;
}

View File

@ -27,8 +27,4 @@ void gtk_icon_theme_lookup_symbolic_colors (GtkCssStyle *style,
GdkRGBA *warning_out,
GdkRGBA *error_out);
GtkIconInfo *gtk_icon_info_new_for_file (GFile *file,
gint size,
gint scale);
#endif /* __GTK_ICON_THEME_PRIVATE_H__ */