changeset 17916:855a767cd9a9

merge of 'a84459ea45867e3dae6ae81f29e4291b3d550190' and 'd2567879c8ffdda7878c7f1748e8abadeea38e50'
author Gabriel Schulhof <nix@go-nix.ca>
date Sat, 02 Jun 2007 07:31:01 +0000
parents 7055885b1b70 (diff) 693990fbbf48 (current diff)
children 5bb6dcba5e4f
files
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkthemes.c	Fri Jun 01 21:28:35 2007 +0000
+++ b/pidgin/gtkthemes.c	Sat Jun 02 07:31:01 2007 +0000
@@ -87,7 +87,7 @@
 
 	if ((last_slash = g_strrstr(theme_dir, G_DIR_SEPARATOR_S)) != NULL) {
 		GSList *iter = NULL;
-		struct smiley_theme *theme = NULL;
+		struct smiley_theme *theme = NULL, *new_theme = NULL;
 
 		*last_slash = 0;
 
@@ -101,8 +101,13 @@
 				break ;
 		}
 		if (iter) {
-			if (theme == current_smiley_theme)
-				current_smiley_theme = ((struct smiley_theme *)(NULL == iter->next ? (smiley_themes == iter ? NULL : smiley_themes->data) : iter->next->data));
+			if (theme == current_smiley_theme) {
+				new_theme = ((struct smiley_theme *)(NULL == iter->next ? (smiley_themes == iter ? NULL : smiley_themes->data) : iter->next->data));
+				if (new_theme)
+					purple_prefs_set_string(PIDGIN_PREFS_ROOT "/smileys/theme", new_theme->name);
+				else
+					current_smiley_theme = NULL;
+			}
 			smiley_themes = g_slist_delete_link(smiley_themes, iter);
 
 			/* Destroy theme structure */