summaryrefslogtreecommitdiff
path: root/gtk/updateiconcache.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-10-21 18:44:08 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-10-21 18:44:08 +0000
commita34d841d7964cdf3cef591700ba3e8baaea4723d (patch)
treeb833f7f9a0b5823856765fdf565f778fa3a0e094 /gtk/updateiconcache.c
parent81c28db09dd7b8c19cedd8d4dddb7389aaeb9f2d (diff)
downloadgtk+-a34d841d7964cdf3cef591700ba3e8baaea4723d.tar.gz
Implement for cached themes.
2004-10-21 Matthias Clasen <mclasen@redhat.com> * gtk/gtkicontheme.c (gtk_icon_theme_has_icon): Implement for cached themes. * gtk/gtkiconcache.h: * gtk/gtkiconcache.c (_gtk_icon_cache_has_icon): New function. * gtk/updateiconcache.c (scan_directory): Don't skip .icon files which are listed before their images. (foreach_remove_func): Instead filter lonely .icon files out here. * gtk/gtkicontheme.c (theme_dir_get_icon_suffix): Filter out the HAS_ICON_FILE flag.
Diffstat (limited to 'gtk/updateiconcache.c')
-rw-r--r--gtk/updateiconcache.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gtk/updateiconcache.c b/gtk/updateiconcache.c
index e6957cff68..4bf31ec656 100644
--- a/gtk/updateiconcache.c
+++ b/gtk/updateiconcache.c
@@ -81,10 +81,19 @@ typedef struct
static gboolean
foreach_remove_func (gpointer key, gpointer value, gpointer user_data)
{
+ Image *image = (Image *)value;
GHashTable *files = user_data;
GList *list;
- gboolean free_key = FALSE;;
-
+ gboolean free_key = FALSE;
+
+ if (image->flags == HAS_ICON_FILE)
+ {
+ g_free (key);
+ g_free (image);
+
+ return TRUE;
+ }
+
list = g_hash_table_lookup (files, key);
if (list)
free_key = TRUE;
@@ -171,7 +180,7 @@ scan_directory (const gchar *base_path,
image = g_hash_table_lookup (dir_hash, basename);
if (image)
image->flags |= flags;
- else if ((flags & HAS_ICON_FILE) != HAS_ICON_FILE)
+ else
{
if (!dir_added)
{