From d6eb5c544d73e4436a5014f2cf45deba8c6678e3 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Tue, 1 Mar 2005 15:16:29 +0000 Subject: [PATCH] Make icon data caching work again. (#168851, Alexander Larsson) 2005-03-01 Matthias Clasen * gtk/gtkicontheme.c (theme_lookup_icon): Make icon data caching work again. (#168851, Alexander Larsson) * gdk-pixbuf/gdk-pixbuf.c: * gdk-pixbuf/gdk-pixbuf-features.h.in: Revert the previous change, since it breaks bin compat. --- ChangeLog | 10 ++++++++++ ChangeLog.pre-2-10 | 10 ++++++++++ ChangeLog.pre-2-8 | 10 ++++++++++ gdk-pixbuf/gdk-pixbuf-features.h.in | 2 +- gdk-pixbuf/gdk-pixbuf.c | 2 +- gtk/gtkicontheme.c | 12 ++++++++---- 6 files changed, 40 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index e64b98d7b9..2c21d7af75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-03-01 Matthias Clasen + + * gtk/gtkicontheme.c (theme_lookup_icon): Make + icon data caching work again. (#168851, Alexander Larsson) + + * gdk-pixbuf/gdk-pixbuf.c: + * gdk-pixbuf/gdk-pixbuf-features.h.in: + Revert the previous change, since it breaks + bin compat. + 2005-03-01 Matthias Clasen * gdk/gdkkeyuni.c diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e64b98d7b9..2c21d7af75 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +2005-03-01 Matthias Clasen + + * gtk/gtkicontheme.c (theme_lookup_icon): Make + icon data caching work again. (#168851, Alexander Larsson) + + * gdk-pixbuf/gdk-pixbuf.c: + * gdk-pixbuf/gdk-pixbuf-features.h.in: + Revert the previous change, since it breaks + bin compat. + 2005-03-01 Matthias Clasen * gdk/gdkkeyuni.c diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e64b98d7b9..2c21d7af75 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +2005-03-01 Matthias Clasen + + * gtk/gtkicontheme.c (theme_lookup_icon): Make + icon data caching work again. (#168851, Alexander Larsson) + + * gdk-pixbuf/gdk-pixbuf.c: + * gdk-pixbuf/gdk-pixbuf-features.h.in: + Revert the previous change, since it breaks + bin compat. + 2005-03-01 Matthias Clasen * gdk/gdkkeyuni.c diff --git a/gdk-pixbuf/gdk-pixbuf-features.h.in b/gdk-pixbuf/gdk-pixbuf-features.h.in index 55309f13be..87eab582a8 100644 --- a/gdk-pixbuf/gdk-pixbuf-features.h.in +++ b/gdk-pixbuf/gdk-pixbuf-features.h.in @@ -36,6 +36,6 @@ GDK_PIXBUF_VAR const guint gdk_pixbuf_major_version; GDK_PIXBUF_VAR const guint gdk_pixbuf_minor_version; GDK_PIXBUF_VAR const guint gdk_pixbuf_micro_version; -GDK_PIXBUF_VAR const char gdk_pixbuf_version[]; +GDK_PIXBUF_VAR const char *gdk_pixbuf_version; #endif diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c index 6936d46e3c..49da10782c 100644 --- a/gdk-pixbuf/gdk-pixbuf.c +++ b/gdk-pixbuf/gdk-pixbuf.c @@ -543,7 +543,7 @@ GDK_PIXBUF_VAR const guint gdk_pixbuf_major_version = GDK_PIXBUF_MAJOR; GDK_PIXBUF_VAR const guint gdk_pixbuf_minor_version = GDK_PIXBUF_MINOR; GDK_PIXBUF_VAR const guint gdk_pixbuf_micro_version = GDK_PIXBUF_MICRO; -GDK_PIXBUF_VAR const char gdk_pixbuf_version[] = GDK_PIXBUF_VERSION; +GDK_PIXBUF_VAR const char *gdk_pixbuf_version = GDK_PIXBUF_VERSION; /* Error quark */ GQuark diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index 77b6c8c7c0..33208fc585 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -1897,7 +1897,12 @@ theme_lookup_icon (IconTheme *theme, icon_info->cp_filename = g_locale_from_utf8 (icon_info->filename, -1, NULL, NULL, NULL); #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; @@ -1910,13 +1915,12 @@ theme_lookup_icon (IconTheme *theme, min_dir->icon_data = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)icon_data_free); 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_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_size = min_dir->size;