summaryrefslogtreecommitdiff
path: root/gtk/gtkicontheme.c
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2006-06-07 04:16:52 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-06-07 04:16:52 +0000
commita9d11e9dba548a9dc15d92f4a518e1ca0b3c85c9 (patch)
treeea7d941ddac27ef796c6b0d0eb091c356b87d789 /gtk/gtkicontheme.c
parent5d76cdf58783cc03c9f64edd16e3a9bff1efbece (diff)
downloadgtk+-a9d11e9dba548a9dc15d92f4a518e1ca0b3c85c9.tar.gz
make the last change work
Diffstat (limited to 'gtk/gtkicontheme.c')
-rw-r--r--gtk/gtkicontheme.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 802554f4f2..9064973427 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -551,6 +551,7 @@ gtk_icon_theme_init (GtkIconTheme *icon_theme)
for (i = 0; xdg_data_dirs[i]; i++) ;
priv->search_path_len = 2 * i + 2;
+ g_print ("search_path_len 1 %d\n", priv->search_path_len);
priv->search_path = g_new (char *, priv->search_path_len);
@@ -663,7 +664,7 @@ gtk_icon_theme_finalize (GObject *object)
g_free (priv->current_theme);
priv->current_theme = NULL;
- for (i=0; i < priv->search_path_len; i++)
+ for (i = 0; i < priv->search_path_len; i++)
g_free (priv->search_path[i]);
g_free (priv->search_path);
@@ -715,6 +716,9 @@ gtk_icon_theme_set_search_path (GtkIconTheme *icon_theme,
priv->search_path = g_new (gchar *, n_elements);
priv->search_path_len = n_elements;
+
+ g_print ("search_path_len 2 %d\n", priv->search_path_len);
+
for (i = 0; i < priv->search_path_len; i++)
priv->search_path[i] = g_strdup (path[i]);
@@ -780,6 +784,9 @@ gtk_icon_theme_append_search_path (GtkIconTheme *icon_theme,
priv = icon_theme->priv;
priv->search_path_len++;
+
+ g_print ("search_path_len 3 %d\n", priv->search_path_len);
+
priv->search_path = g_renew (gchar *, priv->search_path, priv->search_path_len);
priv->search_path[priv->search_path_len-1] = g_strdup (path);
@@ -880,6 +887,7 @@ insert_theme (GtkIconTheme *icon_theme, const char *theme_name)
priv = icon_theme->priv;
+ g_print ("insert_theme %d\n", priv->search_path_len);
for (l = priv->themes; l != NULL; l = l->next)
{
theme = l->data;
@@ -1131,15 +1139,15 @@ static void
_gtk_icon_theme_ensure_builtin_cache (void)
{
static gboolean initialized = FALSE;
- static IconThemeDir dirs[5] = {
- { ICON_THEME_DIR_THRESHOLD, 0, 16, 16, 16, 2, NULL, "16", NULL, NULL, NULL },
- { ICON_THEME_DIR_THRESHOLD, 0, 20, 20, 20, 2, NULL, "20", NULL, NULL, NULL },
- { ICON_THEME_DIR_THRESHOLD, 0, 24, 24, 24, 2, NULL, "24", NULL, NULL, NULL },
- { ICON_THEME_DIR_THRESHOLD, 0, 32, 32, 32, 2, NULL, "32", NULL, NULL, NULL },
- { ICON_THEME_DIR_THRESHOLD, 0, 48, 48, 48, 2, NULL, "48", NULL, NULL, NULL }
- };
IconThemeDir *dir;
- gint n_sizes = G_N_ELEMENTS (dirs);
+ static IconThemeDir dirs[5] =
+ {
+ { ICON_THEME_DIR_THRESHOLD, 0, 16, 16, 16, 2, NULL, "16", NULL, NULL, NULL },
+ { ICON_THEME_DIR_THRESHOLD, 0, 20, 20, 20, 2, NULL, "20", NULL, NULL, NULL },
+ { ICON_THEME_DIR_THRESHOLD, 0, 24, 24, 24, 2, NULL, "24", NULL, NULL, NULL },
+ { ICON_THEME_DIR_THRESHOLD, 0, 32, 32, 32, 2, NULL, "32", NULL, NULL, NULL },
+ { ICON_THEME_DIR_THRESHOLD, 0, 48, 48, 48, 2, NULL, "48", NULL, NULL, NULL }
+ };
gint i;
if (!initialized)
@@ -1148,9 +1156,9 @@ _gtk_icon_theme_ensure_builtin_cache (void)
_builtin_cache = _gtk_icon_cache_new ((gchar *)builtin_icons);
- for (i = 0; i < n_sizes; i++)
+ for (i = 0; i < G_N_ELEMENTS (dirs); i++)
{
- dir = &dir[i];
+ dir = &(dirs[i]);
dir->cache = _gtk_icon_cache_ref (_builtin_cache);
builtin_dirs = g_list_append (builtin_dirs, dir);