diff --git a/capplets/appearance/ChangeLog b/capplets/appearance/ChangeLog index 3912092a1..c3798a1ee 100644 --- a/capplets/appearance/ChangeLog +++ b/capplets/appearance/ChangeLog @@ -1,3 +1,8 @@ +2007-07-28 Denis Washington + + * appearance-style.c: (prepare_list): + Show readable_name in cursor theme list instead of name. + 2007-07-28 Thomas Wood * wp-cellrenderer.c: (cell_renderer_wallpaper_render): Don't draw the diff --git a/capplets/appearance/appearance-style.c b/capplets/appearance/appearance-style.c index be6cf6782..263fc53fd 100644 --- a/capplets/appearance/appearance-style.c +++ b/capplets/appearance/appearance-style.c @@ -774,9 +774,7 @@ prepare_list (AppearanceData *data, GtkWidget *list, ThemeType type, GCallback c label = ((GnomeThemeIconInfo *) l->data)->readable_name; } else if (type == THEME_TYPE_CURSOR) { name = ((GnomeThemeCursorInfo *) l->data)->name; -#ifndef HAVE_XCURSOR - label = ((GnomeThemeCursorInfo *) l->data)->label; -#endif + label = ((GnomeThemeCursorInfo *) l->data)->readable_name; } if (!name) diff --git a/capplets/common/ChangeLog b/capplets/common/ChangeLog index 5a6e17eb5..d6dfe3a16 100644 --- a/capplets/common/ChangeLog +++ b/capplets/common/ChangeLog @@ -1,3 +1,10 @@ +2007-07-28 Denis Washington + + * gnome-theme-info.h: + * gnome-theme-info.c: (look_in_cursor_theme), + (gnome_theme_cursor_info_free): + Read a cursor theme's name from it's index.theme file if it has one. + 2007-07-28 Denis Washington * gnome-theme-info.c: (read_icon_theme): diff --git a/capplets/common/gnome-theme-info.c b/capplets/common/gnome-theme-info.c index d372f6126..3051ec91a 100644 --- a/capplets/common/gnome-theme-info.c +++ b/capplets/common/gnome-theme-info.c @@ -1003,6 +1003,8 @@ static void look_for_cursor_theme (const gchar *theme_dir) { gchar *cursors_dir; + gchar *cursor_theme_file; + GnomeDesktopItem *cursor_theme_ditem; cursors_dir = g_build_filename (theme_dir, "cursors", NULL); @@ -1050,6 +1052,25 @@ look_for_cursor_theme (const gchar *theme_dir) cursor_theme_info->thumbnail = thumbnail; cursor_theme_info->priority = 0; + cursor_theme_file = g_build_filename (theme_dir, "index.theme", NULL); + cursor_theme_ditem = gnome_desktop_item_new_from_file (cursor_theme_file, 0, NULL); + g_free (cursor_theme_file); + + if (cursor_theme_ditem) { + const gchar *readable_name; + + readable_name = (gchar *) gnome_desktop_item_get_string (cursor_theme_ditem, "Icon Theme/Name"); + + if (readable_name) + cursor_theme_info->readable_name = g_strdup (readable_name); + else + cursor_theme_info->readable_name = g_strdup (name); + + gnome_desktop_item_unref (cursor_theme_ditem); + } else { + cursor_theme_info->readable_name = g_strdup (name); + } + g_hash_table_insert (cursor_theme_hash_by_uri, cursor_theme_info->path, cursor_theme_info); add_data_to_hash_by_name (cursor_theme_hash_by_name, name, cursor_theme_info); } @@ -1478,6 +1499,7 @@ void gnome_theme_cursor_info_free (GnomeThemeCursorInfo *cursor_theme_info) { g_free (cursor_theme_info->name); + g_free (cursor_theme_info->readable_name); g_free (cursor_theme_info->path); g_array_free (cursor_theme_info->sizes, TRUE); g_object_unref (cursor_theme_info->thumbnail); @@ -1811,9 +1833,9 @@ read_cursor_fonts (void) theme_info->name = theme_info->path = g_build_filename (GNOMECC_DATA_DIR, builtins[i][0], NULL); if (!strcmp (theme_info->path, cursor_font)) - theme_info->label = g_strdup (builtins[i][2]); + theme_info->readable_name = g_strdup (builtins[i][2]); else - theme_info->label = g_strdup (builtins[i][1]); + theme_info->readable_name = g_strdup (builtins[i][1]); g_hash_table_insert (cursor_theme_hash_by_uri, theme_info->path, theme_info); add_data_to_hash_by_name (cursor_theme_hash_by_name, theme_info->name, theme_info); diff --git a/capplets/common/gnome-theme-info.h b/capplets/common/gnome-theme-info.h index 1e8d97e02..34dbdf8b6 100644 --- a/capplets/common/gnome-theme-info.h +++ b/capplets/common/gnome-theme-info.h @@ -75,12 +75,10 @@ typedef struct _GnomeThemeCursorInfo GnomeThemeCursorInfo; struct _GnomeThemeCursorInfo { gchar *path; gchar *name; + gchar *readable_name; gint priority; GArray *sizes; GdkPixbuf *thumbnail; -#ifndef HAVE_XCURSOR - gchar *label; -#endif }; typedef struct _GnomeThemeMetaInfo GnomeThemeMetaInfo;