search the GTK+ icon theme search path for icon themes, not just selected

2009-03-19  Jens Granseuer  <jensgr@gmx.net>

	* gnome-theme-info.c: (gnome_theme_init): search the GTK+ icon theme
	search path for icon themes, not just selected directories (fixes
	bug #575906)

svn path=/trunk/; revision=9374
This commit is contained in:
Jens Granseuer 2009-03-19 18:44:01 +00:00 committed by Jens Granseuer
parent d0b55a8864
commit 4ced2119f6
2 changed files with 24 additions and 27 deletions

View file

@ -1,3 +1,9 @@
2009-03-19 Jens Granseuer <jensgr@gmx.net>
* gnome-theme-info.c: (gnome_theme_init): search the GTK+ icon theme
search path for icon themes, not just selected directories (fixes
bug #575906)
==================== 2.25.90 ====================
2009-01-25 Jens Granseuer <jensgr@gmx.net>

View file

@ -1823,7 +1823,9 @@ gnome_theme_init ()
GFile *top_theme_dir;
gchar *top_theme_dir_string;
static gboolean initted = FALSE;
const gchar *gtk_data_dir;
gchar **search_path;
gint i, n;
if (initted)
return;
@ -1855,44 +1857,33 @@ gnome_theme_init ()
add_top_theme_dir_monitor (top_theme_dir, 0, NULL);
g_object_unref (top_theme_dir);
/* The weird /usr/share/icons */
top_theme_dir = g_file_new_for_path ("/usr/share/icons");
add_top_icon_theme_dir_monitor (top_theme_dir, 2, NULL);
/* ~/.icons */
top_theme_dir_string = g_build_filename (g_get_home_dir (), ".icons", NULL);
top_theme_dir = g_file_new_for_path (top_theme_dir_string);
g_free (top_theme_dir_string);
if (!g_file_query_exists (top_theme_dir, NULL))
g_file_make_directory (top_theme_dir, NULL, NULL);
g_object_unref (top_theme_dir);
/* $datadir/icons */
gtk_data_dir = g_getenv ("GTK_DATA_PREFIX");
if (gtk_data_dir)
top_theme_dir_string = g_build_filename (gtk_data_dir, "share", "icons", NULL);
else
top_theme_dir_string = g_build_filename (INSTALL_PREFIX, "share", "icons", NULL);
/* icon theme search path */
gtk_icon_theme_get_search_path (gtk_icon_theme_get_default (), &search_path, &n);
for (i = 0; i < n; ++i) {
top_theme_dir = g_file_new_for_path (search_path[i]);
add_top_icon_theme_dir_monitor (top_theme_dir, i, NULL);
g_object_unref (top_theme_dir);
}
g_strfreev (search_path);
#ifdef XCURSOR_ICONDIR
/* if there's a separate xcursors dir, add that as well */
if (strcmp (XCURSOR_ICONDIR, top_theme_dir_string) &&
strcmp (XCURSOR_ICONDIR, "/usr/share/icons")) {
top_theme_dir = g_file_new_for_path (XCURSOR_ICONDIR);
if (g_file_query_exists (top_theme_dir, NULL))
add_top_icon_theme_dir_monitor (top_theme_dir, 1, NULL);
add_top_icon_theme_dir_monitor (top_theme_dir, 1, NULL);
g_object_unref (top_theme_dir);
}
#endif
top_theme_dir = g_file_new_for_path (top_theme_dir_string);
g_free (top_theme_dir_string);
add_top_icon_theme_dir_monitor (top_theme_dir, 1, NULL);
g_object_unref (top_theme_dir);
/* ~/.icons */
top_theme_dir_string = g_build_filename (g_get_home_dir (), ".icons", NULL);
top_theme_dir = g_file_new_for_path (top_theme_dir_string);
g_free (top_theme_dir_string);
if (!g_file_query_exists (top_theme_dir, NULL))
g_file_make_directory (top_theme_dir, NULL, NULL);
add_top_icon_theme_dir_monitor (top_theme_dir, 0, NULL);
g_object_unref (top_theme_dir);
#ifdef HAVE_XCURSOR
/* make sure we have the default theme */
if (!gnome_theme_cursor_info_find ("default"))