-#if 0
-void
-gtk_file_info_set_icon_type (GtkFileInfo *info,
- GtkFileIconType icon_type)
-{
- g_return_if_fail (info != NULL);
-
- info->icon_type = icon_type;
-}
-
-GtkFileIconType
-gtk_file_info_get_icon_type (const GtkFileInfo *info)
-{
- g_return_val_if_fail (info != NULL, GTK_FILE_ICON_REGULAR);
-
- return info->icon_type;
-}
-
-typedef struct _IconCacheElement IconCacheElement;
-
-struct _IconCacheElement
-{
- gint size;
- GdkPixbuf *pixbuf;
-};
-
-static void
-icon_cache_element_free (IconCacheElement *element)
-{
- if (element->pixbuf)
- g_object_unref (element->pixbuf);
- g_free (element);
-}
-
-static void
-icon_theme_changed (GtkIconTheme *icon_theme)
-{
- GHashTable *cache;
-
- /* Difference from the initial creation is that we don't
- * reconnect the signal
- */
- cache = g_hash_table_new_full (g_str_hash, g_str_equal,
- (GDestroyNotify)g_free,
- (GDestroyNotify)icon_cache_element_free);
- g_object_set_data_full (G_OBJECT (icon_theme), "gtk-file-icon-cache",
- cache, (GDestroyNotify)g_hash_table_destroy);
-}
-
-static GdkPixbuf *
-get_cached_icon (GtkWidget *widget,
- const gchar *name,
- gint pixel_size)
-{
- GtkIconTheme *icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget));
- GHashTable *cache = g_object_get_data (G_OBJECT (icon_theme), "gtk-file-icon-cache");
- IconCacheElement *element;
-
- if (!cache)
- {
- cache = g_hash_table_new_full (g_str_hash, g_str_equal,
- (GDestroyNotify)g_free,
- (GDestroyNotify)icon_cache_element_free);
-
- g_object_set_data_full (G_OBJECT (icon_theme), "gtk-file-icon-cache",
- cache, (GDestroyNotify)g_hash_table_destroy);
- g_signal_connect (icon_theme, "changed",
- G_CALLBACK (icon_theme_changed), NULL);
- }
-
- element = g_hash_table_lookup (cache, name);
- if (!element)
- {
- element = g_new0 (IconCacheElement, 1);
- g_hash_table_insert (cache, g_strdup (name), element);
- }
-
- if (element->size != pixel_size)
- {
- if (element->pixbuf)
- g_object_unref (element->pixbuf);
- element->size = pixel_size;
- element->pixbuf = gtk_icon_theme_load_icon (icon_theme, name,
- pixel_size, 0, NULL);
- }
-
- return element->pixbuf ? g_object_ref (element->pixbuf) : NULL;
-}
-
-
-GdkPixbuf *
-gtk_file_info_render_icon (const GtkFileInfo *info,
- GtkWidget *widget,
- gint pixel_size)
-{
- const gchar *separator;
- GdkPixbuf *pixbuf;
- GString *icon_name;
-
- g_return_val_if_fail (info != NULL, NULL);
- g_return_val_if_fail (widget != NULL, NULL);
- g_return_val_if_fail (pixel_size > 0, NULL);
-
- if (info->icon_type != GTK_FILE_ICON_REGULAR)
- {
- const char *name = NULL; /* Quiet gcc */
-
- switch (info->icon_type)
- {
- case GTK_FILE_ICON_BLOCK_DEVICE:
- name ="gnome-fs-blockdev";
- break;
- case GTK_FILE_ICON_BROKEN_SYMBOLIC_LINK:
- name = "gnome-fs-symlink";
- break;
- case GTK_FILE_ICON_CHARACTER_DEVICE:
- name = "gnome-fs-chardev";
- break;
- case GTK_FILE_ICON_DIRECTORY:
- name = "gnome-fs-directory";
- break;
- case GTK_FILE_ICON_EXECUTABLE:
- name ="gnome-fs-executable";
- break;
- case GTK_FILE_ICON_FIFO:
- name = "gnome-fs-fifo";
- break;
- case GTK_FILE_ICON_SOCKET:
- name = "gnome-fs-socket";
- break;
- case GTK_FILE_ICON_REGULAR:
- g_assert_not_reached ();
- }
-
- return get_cached_icon (widget, name, pixel_size);
- }
-
- if (!info->mime_type)
- return NULL;
-
- separator = strchr (info->mime_type, '/');
- if (!separator)
- return NULL;
-
- icon_name = g_string_new ("gnome-mime-");
- g_string_append_len (icon_name, info->mime_type, separator - info->mime_type);
- g_string_append_c (icon_name, '-');
- g_string_append (icon_name, separator + 1);
- pixbuf = get_cached_icon (widget, icon_name->str, pixel_size);
- g_string_free (icon_name, TRUE);
- if (pixbuf)
- return pixbuf;
-
- icon_name = g_string_new ("gnome-mime-");
- g_string_append_len (icon_name, info->mime_type, separator - info->mime_type);
- pixbuf = get_cached_icon (widget, icon_name->str, pixel_size);
- g_string_free (icon_name, TRUE);
- if (pixbuf)
- return pixbuf;
-
- return get_cached_icon (widget, "gnome-fs-regular", pixel_size);
-}
-#endif