mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 02:40:11 +00:00
icontheme: Stop exporting gtk_icon_info_new_for_file
This commit is contained in:
parent
0c017ff109
commit
797739198f
@ -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;
|
||||
}
|
||||
|
@ -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__ */
|
||||
|
Loading…
Reference in New Issue
Block a user