Skip to content

Commit

Permalink
icontheme: Keep dir_mtimes in order
Browse files Browse the repository at this point in the history
Don't reverse the order each time we insert a theme. Reverse it only
once, after all themes have been loaded.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/1115
  • Loading branch information
heftig committed May 23, 2018
1 parent a7cd208 commit 3bb6670
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gtk/gtkicontheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,6 @@ insert_theme (GtkIconTheme *icon_theme,

priv->dir_mtimes = g_list_prepend (priv->dir_mtimes, dir_mtime);
}
priv->dir_mtimes = g_list_reverse (priv->dir_mtimes);

theme_file = NULL;
for (i = 0; i < priv->search_path_len && !theme_file; i++)
Expand Down Expand Up @@ -1389,7 +1388,7 @@ load_themes (GtkIconTheme *icon_theme)
dir = icon_theme->priv->search_path[base];

dir_mtime = g_slice_new (IconThemeDirMtime);
priv->dir_mtimes = g_list_append (priv->dir_mtimes, dir_mtime);
priv->dir_mtimes = g_list_prepend (priv->dir_mtimes, dir_mtime);

dir_mtime->dir = g_strdup (dir);
dir_mtime->mtime = 0;
Expand All @@ -1414,6 +1413,7 @@ load_themes (GtkIconTheme *icon_theme)

g_dir_close (gdir);
}
priv->dir_mtimes = g_list_reverse (priv->dir_mtimes);

for (d = priv->resource_paths; d; d = d->next)
{
Expand Down

0 comments on commit 3bb6670

Please sign in to comment.