Make icon data caching work again. (#168851, Alexander Larsson)

2005-03-01  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkicontheme.c (theme_lookup_icon): Make
	icon data caching work again.  (#168851, Alexander Larsson)
This commit is contained in:
Matthias Clasen
2005-03-01 14:59:04 +00:00
committed by Matthias Clasen
parent 6834bb9597
commit 86db923391
4 changed files with 17 additions and 4 deletions

View File

@ -1,5 +1,8 @@
2005-03-01 Matthias Clasen <mclasen@redhat.com> 2005-03-01 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkicontheme.c (theme_lookup_icon): Make
icon data caching work again. (#168851, Alexander Larsson)
* gdk-pixbuf/gdk-pixbuf.c: * gdk-pixbuf/gdk-pixbuf.c:
* gdk-pixbuf/gdk-pixbuf-features.h.in: * gdk-pixbuf/gdk-pixbuf-features.h.in:
Revert the previous change, since it breaks Revert the previous change, since it breaks

View File

@ -1,5 +1,8 @@
2005-03-01 Matthias Clasen <mclasen@redhat.com> 2005-03-01 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkicontheme.c (theme_lookup_icon): Make
icon data caching work again. (#168851, Alexander Larsson)
* gdk-pixbuf/gdk-pixbuf.c: * gdk-pixbuf/gdk-pixbuf.c:
* gdk-pixbuf/gdk-pixbuf-features.h.in: * gdk-pixbuf/gdk-pixbuf-features.h.in:
Revert the previous change, since it breaks Revert the previous change, since it breaks

View File

@ -1,5 +1,8 @@
2005-03-01 Matthias Clasen <mclasen@redhat.com> 2005-03-01 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkicontheme.c (theme_lookup_icon): Make
icon data caching work again. (#168851, Alexander Larsson)
* gdk-pixbuf/gdk-pixbuf.c: * gdk-pixbuf/gdk-pixbuf.c:
* gdk-pixbuf/gdk-pixbuf-features.h.in: * gdk-pixbuf/gdk-pixbuf-features.h.in:
Revert the previous change, since it breaks Revert the previous change, since it breaks

View File

@ -1897,7 +1897,12 @@ theme_lookup_icon (IconTheme *theme,
icon_info->cp_filename = g_locale_from_utf8 (icon_info->filename, icon_info->cp_filename = g_locale_from_utf8 (icon_info->filename,
-1, NULL, NULL, NULL); -1, NULL, NULL, NULL);
#endif #endif
if (min_dir->cache && has_icon_file)
if (min_dir->icon_data != NULL)
icon_info->data = g_hash_table_lookup (min_dir->icon_data, icon_name);
if (icon_info->data == NULL &&
min_dir->cache && has_icon_file)
{ {
gchar *icon_file_name, *icon_file_path; gchar *icon_file_name, *icon_file_path;
@ -1910,13 +1915,12 @@ theme_lookup_icon (IconTheme *theme,
min_dir->icon_data = g_hash_table_new_full (g_str_hash, g_str_equal, min_dir->icon_data = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, (GDestroyNotify)icon_data_free); g_free, (GDestroyNotify)icon_data_free);
load_icon_data (min_dir, icon_file_path, icon_file_name); load_icon_data (min_dir, icon_file_path, icon_file_name);
icon_info->data = g_hash_table_lookup (min_dir->icon_data, icon_name);
} }
g_free (icon_file_name); g_free (icon_file_name);
g_free (icon_file_path); g_free (icon_file_path);
} }
if (min_dir->icon_data != NULL)
icon_info->data = g_hash_table_lookup (min_dir->icon_data, icon_name);
icon_info->dir_type = min_dir->type; icon_info->dir_type = min_dir->type;
icon_info->dir_size = min_dir->size; icon_info->dir_size = min_dir->size;