diff options
author | Matthias Clasen <mclasen@redhat.com> | 2007-01-02 04:19:28 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2007-01-02 04:19:28 +0000 |
commit | bcf7d7e972d1fd814fd8a340edc427a6cc9ee7b5 (patch) | |
tree | 82446e023eb813f5ce770d644c09acf38b2a96e7 /gtk/gtkicontheme.c | |
parent | 0dd1afdfca7d6c173cbd30aab28119a65dc87493 (diff) | |
download | gtk+-bcf7d7e972d1fd814fd8a340edc427a6cc9ee7b5.tar.gz |
Waste less time with non-directories. (#391725, Chris Wilson)
2007-01-01 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkicontheme.c (load_themes): Waste less time
with non-directories. (#391725, Chris Wilson)
svn path=/trunk/; revision=17005
Diffstat (limited to 'gtk/gtkicontheme.c')
-rw-r--r-- | gtk/gtkicontheme.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index e986b40061..6cb06aeb7b 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -1047,20 +1047,21 @@ load_themes (GtkIconTheme *icon_theme) dir = icon_theme->priv->search_path[base]; dir_mtime = g_slice_new (IconThemeDirMtime); - dir_mtime->cache = _gtk_icon_cache_new_for_path (dir); - dir_mtime->dir = g_strdup (dir); - if (g_stat (dir, &stat_buf) == 0 && S_ISDIR (stat_buf.st_mode)) - dir_mtime->mtime = stat_buf.st_mtime; - else - dir_mtime->mtime = 0; - priv->dir_mtimes = g_list_append (priv->dir_mtimes, dir_mtime); + dir_mtime->dir = g_strdup (dir); + dir_mtime->mtime = 0; + dir_mtime->cache = NULL; + + if (g_stat (dir, &stat_buf) != 0 || !S_ISDIR (stat_buf.st_mode)) + continue; + dir_mtime->mtime = stat_buf.st_mtime; + + dir_mtime->cache = _gtk_icon_cache_new_for_path (dir); if (dir_mtime->cache != NULL) continue; gdir = g_dir_open (dir, 0, NULL); - if (gdir == NULL) continue; |