Index: capplets/theme-switcher/ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/theme-switcher/ChangeLog,v
retrieving revision 1.144
diff -u -r1.144 ChangeLog
--- capplets/theme-switcher/ChangeLog	3 Jan 2005 18:08:20 -0000	1.144
+++ capplets/theme-switcher/ChangeLog	6 Jan 2005 04:46:49 -0000
@@ -1,3 +1,9 @@
+2005-01-06  Shakti Sen <shprasad@novell.com>
+
+	* gnome-theme-installer.c (install_dialog_response):
+	To check the permission of .themes directory.
+	Fixes bug #161649
+
 2005-01-03  Sebastien Bacher  <seb128@debian.org>
 
 	* gnome-theme-installer.c: (install_dialog_response): use a temporary
Index: capplets/theme-switcher/gnome-theme-installer.c
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/theme-switcher/gnome-theme-installer.c,v
retrieving revision 1.12
diff -u -r1.12 gnome-theme-installer.c
--- capplets/theme-switcher/gnome-theme-installer.c	3 Jan 2005 18:08:23 -0000	1.12
+++ capplets/theme-switcher/gnome-theme-installer.c	6 Jan 2005 04:48:40 -0000
@@ -118,6 +118,7 @@
 	const gchar *raw;
 	gboolean icon_theme;
 	gchar *temppath;
+	gchar *dir_path;
 
 	if (response_id == GTK_RESPONSE_HELP) {
 		capplet_help (GTK_WINDOW (widget),
@@ -162,12 +163,16 @@
 		src_uri = gnome_vfs_uri_new (filename);
 		base = gnome_vfs_uri_extract_short_name (src_uri);
 		src = g_list_append (NULL, src_uri);
-		if (icon_theme)
+		if (icon_theme) {
 			path = g_build_filename (g_get_home_dir (), ".icons", base, NULL);
-		else
+			dir_path = g_build_filename (g_get_home_dir (), ".icons", NULL);
+		}
+		else {
 			path = g_build_filename (g_get_home_dir (), ".themes", base, NULL);
+			dir_path = g_build_filename (g_get_home_dir (), ".themes", NULL);
+		}
 
-		if (access (path, X_OK | W_OK) != 0) {
+		if (access (dir_path, X_OK | W_OK) != 0) {
                         GtkWidget *dialog;
 
                         dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
@@ -176,8 +181,10 @@
                                                           _("Insufficient permissions to install the theme in:\n%s"), path);
 			gtk_dialog_run (GTK_DIALOG (dialog));
 			gtk_widget_destroy (dialog);
+			g_free (dir_path);
 			return;
                 } 
+		g_free (dir_path);
 		
 		while(TRUE) {
 		  	gchar *file_tmp;
