From 777a257df88da3b5d5c9a49fef4c0632fcfaa98b Mon Sep 17 00:00:00 2001 From: Jens Granseuer Date: Tue, 21 Aug 2007 21:22:50 +0000 Subject: [PATCH] Properly check all stored themes if necessary. This fixes cases where e.g. 2007-08-21 Jens Granseuer * gnome-theme-info.c: (gnome_theme_info_find_by_type_helper): Properly check all stored themes if necessary. This fixes cases where e.g. a metacity theme in ~/.themes would hide a GTK theme with the same name in the system theme dir svn path=/trunk/; revision=8032 --- capplets/common/ChangeLog | 7 +++++++ capplets/common/gnome-theme-info.c | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/capplets/common/ChangeLog b/capplets/common/ChangeLog index 62685e061..7aff1cb1f 100644 --- a/capplets/common/ChangeLog +++ b/capplets/common/ChangeLog @@ -1,3 +1,10 @@ +2007-08-21 Jens Granseuer + + * gnome-theme-info.c: (gnome_theme_info_find_by_type_helper): + Properly check all stored themes if necessary. This fixes cases where + e.g. a metacity theme in ~/.themes would hide a GTK theme with the + same name in the system theme dir + 2007-08-21 Luca Cavalli * file-transfer-dialog.c: (format_uri_for_display), diff --git a/capplets/common/gnome-theme-info.c b/capplets/common/gnome-theme-info.c index f1b8c842c..2fd9fbd53 100644 --- a/capplets/common/gnome-theme-info.c +++ b/capplets/common/gnome-theme-info.c @@ -1404,12 +1404,19 @@ gnome_theme_info_find_by_type_helper (gpointer key, struct GnomeThemeInfoHashData *hash_data) { guint elements = GPOINTER_TO_INT (hash_data->user_data); - GnomeThemeInfo *theme_info = list->data; - if ((elements & GNOME_THEME_METACITY && theme_info->has_metacity) || - (elements & GNOME_THEME_GTK_2 && theme_info->has_gtk) || - (elements & GNOME_THEME_GTK_2_KEYBINDING && theme_info->has_keybinding)) - hash_data->list = g_list_prepend (hash_data->list, theme_info); + do { + GnomeThemeInfo *theme_info = list->data; + + if ((elements & GNOME_THEME_METACITY && theme_info->has_metacity) || + (elements & GNOME_THEME_GTK_2 && theme_info->has_gtk) || + (elements & GNOME_THEME_GTK_2_KEYBINDING && theme_info->has_keybinding)) { + hash_data->list = g_list_prepend (hash_data->list, theme_info); + return; + } + + list = list->next; + } while (list); } GList *