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:
parent
d0b55a8864
commit
4ced2119f6
2 changed files with 24 additions and 27 deletions
|
@ -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 ====================
|
==================== 2.25.90 ====================
|
||||||
|
|
||||||
2009-01-25 Jens Granseuer <jensgr@gmx.net>
|
2009-01-25 Jens Granseuer <jensgr@gmx.net>
|
||||||
|
|
|
@ -1823,7 +1823,9 @@ gnome_theme_init ()
|
||||||
GFile *top_theme_dir;
|
GFile *top_theme_dir;
|
||||||
gchar *top_theme_dir_string;
|
gchar *top_theme_dir_string;
|
||||||
static gboolean initted = FALSE;
|
static gboolean initted = FALSE;
|
||||||
const gchar *gtk_data_dir;
|
gchar **search_path;
|
||||||
|
gint i, n;
|
||||||
|
|
||||||
if (initted)
|
if (initted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1855,44 +1857,33 @@ gnome_theme_init ()
|
||||||
add_top_theme_dir_monitor (top_theme_dir, 0, NULL);
|
add_top_theme_dir_monitor (top_theme_dir, 0, NULL);
|
||||||
g_object_unref (top_theme_dir);
|
g_object_unref (top_theme_dir);
|
||||||
|
|
||||||
/* The weird /usr/share/icons */
|
/* ~/.icons */
|
||||||
top_theme_dir = g_file_new_for_path ("/usr/share/icons");
|
top_theme_dir_string = g_build_filename (g_get_home_dir (), ".icons", NULL);
|
||||||
add_top_icon_theme_dir_monitor (top_theme_dir, 2, 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);
|
g_object_unref (top_theme_dir);
|
||||||
|
|
||||||
/* $datadir/icons */
|
/* icon theme search path */
|
||||||
gtk_data_dir = g_getenv ("GTK_DATA_PREFIX");
|
gtk_icon_theme_get_search_path (gtk_icon_theme_get_default (), &search_path, &n);
|
||||||
if (gtk_data_dir)
|
for (i = 0; i < n; ++i) {
|
||||||
top_theme_dir_string = g_build_filename (gtk_data_dir, "share", "icons", NULL);
|
top_theme_dir = g_file_new_for_path (search_path[i]);
|
||||||
else
|
add_top_icon_theme_dir_monitor (top_theme_dir, i, NULL);
|
||||||
top_theme_dir_string = g_build_filename (INSTALL_PREFIX, "share", "icons", NULL);
|
g_object_unref (top_theme_dir);
|
||||||
|
}
|
||||||
|
g_strfreev (search_path);
|
||||||
|
|
||||||
#ifdef XCURSOR_ICONDIR
|
#ifdef XCURSOR_ICONDIR
|
||||||
/* if there's a separate xcursors dir, add that as well */
|
/* if there's a separate xcursors dir, add that as well */
|
||||||
if (strcmp (XCURSOR_ICONDIR, top_theme_dir_string) &&
|
if (strcmp (XCURSOR_ICONDIR, top_theme_dir_string) &&
|
||||||
strcmp (XCURSOR_ICONDIR, "/usr/share/icons")) {
|
strcmp (XCURSOR_ICONDIR, "/usr/share/icons")) {
|
||||||
top_theme_dir = g_file_new_for_path (XCURSOR_ICONDIR);
|
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);
|
g_object_unref (top_theme_dir);
|
||||||
}
|
}
|
||||||
#endif
|
#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
|
#ifdef HAVE_XCURSOR
|
||||||
/* make sure we have the default theme */
|
/* make sure we have the default theme */
|
||||||
if (!gnome_theme_cursor_info_find ("default"))
|
if (!gnome_theme_cursor_info_find ("default"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue