#include "gtkiconcache.h"
#include "gtkbuiltincache.h"
#include "gtkintl.h"
+#include "gtkmain.h"
#include "gtksettings.h"
#include "gtkprivate.h"
#include "gtkalias.h"
_gtk_icon_cache_unref (dir_mtime->cache);
g_free (dir_mtime->dir);
- g_free (dir_mtime);
+ g_slice_free (IconThemeDirMtime, dir_mtime);
}
if (!priv->reset_styles_idle)
priv->reset_styles_idle =
- g_idle_add (reset_styles_idle, icon_theme);
+ g_idle_add_full (GTK_PRIORITY_RESIZE - 2,
+ reset_styles_idle, icon_theme, NULL);
}
static void
path = g_build_filename (priv->search_path[i],
theme_name,
NULL);
- dir_mtime = g_new (IconThemeDirMtime, 1);
+ dir_mtime = g_slice_new (IconThemeDirMtime);
dir_mtime->cache = NULL;
dir_mtime->dir = path;
if (g_stat (path, &stat_buf) == 0 && S_ISDIR (stat_buf.st_mode))
{
dir = icon_theme->priv->search_path[base];
- dir_mtime = g_new (IconThemeDirMtime, 1);
+ 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))
priv->last_stat_time = tv.tv_sec;
}
-static void
+void
_gtk_icon_theme_ensure_builtin_cache (void)
{
static gboolean initialized = FALSE;
char *base_name;
char **split;
gsize length;
- char *dot;
char *str;
char *split_point;
int i;
}
else
{
- base_name = g_strdup (name);
- dot = strrchr (base_name, '.');
- *dot = 0;
+ base_name = strip_suffix (name);
data = g_slice_new0 (GtkIconData);
g_hash_table_replace (dir->icon_data, base_name, data);