summaryrefslogtreecommitdiff
path: root/gtk/gtkicontheme.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-08-17 19:51:11 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-08-17 19:51:11 +0000
commit11396cb71fead96005e002d60c7065bc944bafce (patch)
tree5e3f4a0b481b703f7e9c369dfbb16cf1a03c28c3 /gtk/gtkicontheme.c
parenteacbe5e136e0e0b0709724cd6858522af4cf1d64 (diff)
downloadgdk-pixbuf-11396cb71fead96005e002d60c7065bc944bafce.tar.gz
Look up icon themes in the directories specified in the icon theme spec:
2004-08-17 Matthias Clasen <mclasen@redhat.com> * gtk/gtkicontheme.c (gtk_icon_theme_init): Look up icon themes in the directories specified in the icon theme spec: $HOME/.icons, $XDG_DATA_DIRS/icons, /usr/share/pixmaps. Note that GTK+ used to also look in $GTK_DATA_DIR/icons, $GTK_DATA_DIR/pixmaps and /usr/share/icons. (#148694)
Diffstat (limited to 'gtk/gtkicontheme.c')
-rw-r--r--gtk/gtkicontheme.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index b8db2b640..edc6ca64b 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -524,24 +524,31 @@ static void
gtk_icon_theme_init (GtkIconTheme *icon_theme)
{
GtkIconThemePrivate *priv;
-
+ gchar **xdg_data_dirs;
+ int i, j;
+
priv = g_type_instance_get_private ((GTypeInstance *)icon_theme,
GTK_TYPE_ICON_THEME);
icon_theme->priv = priv;
priv->custom_theme = FALSE;
priv->current_theme = g_strdup (DEFAULT_THEME_NAME);
- priv->search_path = g_new (char *, 5);
+
+ xdg_data_dirs = g_get_system_data_dirs ();
+ for (i = 0; xdg_data_dirs[i]; i++) ;
+
+ priv->search_path_len = i + 3;
+
+ priv->search_path = g_new (char *, priv->search_path_len);
+
+ i = 0;
+ priv->search_path[i++] = g_build_filename (g_get_home_dir (), ".icons", NULL);
+ priv->search_path[i++] = g_build_filename (g_get_user_data_dir (), "icons", NULL);
+ for (j = 0; xdg_data_dirs[j]; j++)
+ priv->search_path[i++] = g_build_filename (xdg_data_dirs[j], "icons", NULL);
- priv->search_path[0] = g_build_filename (g_get_home_dir (),
- ".icons",
- NULL);
- priv->search_path[1] = g_build_filename (GTK_DATADIR, "pixmaps", NULL);
- priv->search_path[2] = g_build_filename (GTK_DATADIR, "icons", NULL);
- priv->search_path[3] = g_strdup ("/usr/share/icons");
- priv->search_path[4] = g_strdup ("/usr/share/pixmaps");
- priv->search_path_len = 5;
+ priv->search_path[i++] = g_strdup ("/usr/share/pixmaps");
priv->themes_valid = FALSE;
priv->themes = NULL;