From a90379247be14949b982e98c35b1101f46d16331 Mon Sep 17 00:00:00 2001 From: Thomas Wood Date: Sat, 6 Jan 2007 23:34:20 +0000 Subject: [PATCH] Applied patch from Priit Laes . Fixes bug 349471 (Crash 2007-01-11 Thomas Wood * gnome-theme-info.c: (update_common_theme_dir_index): Applied patch from Priit Laes . Fixes bug 349471 (Crash on manually changing the icon theme name). svn path=/trunk/; revision=7071 --- capplets/common/ChangeLog | 6 ++++++ capplets/common/gnome-theme-info.c | 21 +++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/capplets/common/ChangeLog b/capplets/common/ChangeLog index dd666a6dd..ea3b149d1 100644 --- a/capplets/common/ChangeLog +++ b/capplets/common/ChangeLog @@ -1,3 +1,9 @@ +2007-01-11 Thomas Wood + + * gnome-theme-info.c: (update_common_theme_dir_index): Applied patch + from Priit Laes . Fixes bug 349471 (Crash on manually + changing the icon theme name). + 2007-01-06 Lucas Rocha Fixes #336286 diff --git a/capplets/common/gnome-theme-info.c b/capplets/common/gnome-theme-info.c index d5ca7307b..3f44d4e3a 100644 --- a/capplets/common/gnome-theme-info.c +++ b/capplets/common/gnome-theme-info.c @@ -713,22 +713,21 @@ update_common_theme_dir_index (GnomeVFSURI *theme_index_uri, handle_change_signal (icon_theme?GNOME_THEME_TYPE_ICON:GNOME_THEME_TYPE_METATHEME, theme_info, GNOME_THEME_CHANGE_CREATED, 0); } - } - else - { - if (theme_exists) - { + } else { + if (theme_exists) { gint cmp; if (icon_theme) cmp = gnome_theme_icon_info_compare (theme_info, old_theme_info); else cmp = gnome_theme_meta_info_compare (theme_info, old_theme_info); - if (cmp != 0) - { - g_hash_table_insert (hash_by_uri, g_strdup (common_theme_dir), theme_info); - add_data_to_hash_by_name (hash_by_name, name, theme_info); - handle_change_signal (icon_theme?GNOME_THEME_TYPE_ICON:GNOME_THEME_TYPE_METATHEME, + if (cmp != 0) { + // Remove old theme + g_hash_table_remove (hash_by_uri, common_theme_dir); + remove_data_from_hash_by_name (hash_by_name, ((GnomeThemeIconInfo *)old_theme_info)->name, old_theme_info); + g_hash_table_insert (hash_by_uri, g_strdup (common_theme_dir), theme_info); + add_data_to_hash_by_name (hash_by_name, name, theme_info); + handle_change_signal (icon_theme?GNOME_THEME_TYPE_ICON:GNOME_THEME_TYPE_METATHEME, theme_info, GNOME_THEME_CHANGE_CHANGED, 0); if (icon_theme) gnome_theme_icon_info_free (old_theme_info); @@ -750,8 +749,6 @@ update_common_theme_dir_index (GnomeVFSURI *theme_index_uri, else name = ((GnomeThemeMetaInfo *)old_theme_info)->name; - g_hash_table_remove (hash_by_uri, common_theme_dir); - remove_data_from_hash_by_name (hash_by_name, name, old_theme_info); handle_change_signal (icon_theme?GNOME_THEME_TYPE_ICON:GNOME_THEME_TYPE_METATHEME, old_theme_info, GNOME_THEME_CHANGE_DELETED, 0); if (icon_theme)