Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/theme-switcher/ChangeLog,v
retrieving revision 1.142
diff -u -r1.142 ChangeLog
--- ChangeLog	9 Nov 2004 17:43:47 -0000	1.142
+++ ChangeLog	22 Dec 2004 11:44:09 -0000
@@ -1,3 +1,9 @@
+2004-12-22  Shakti Sen <shprasad@novell.com>
+
+	* gnome-theme-installer.c (install_dialog_response):
+	To check the permission of .themes directory.
+	Fixes bug #161649
+
 2004-11-09  Mark McLoughlin  <mark@skynet.ie>
 
 	* Makefile.am: install .desktop file in $(datadir)/applications.
Index: gnome-theme-installer.c
===================================================================
RCS file: /cvs/gnome/gnome-control-center/capplets/theme-switcher/gnome-theme-installer.c,v
retrieving revision 1.10
diff -u -r1.10 gnome-theme-installer.c
--- gnome-theme-installer.c	2 Nov 2004 22:17:48 -0000	1.10
+++ gnome-theme-installer.c	22 Dec 2004 11:44:16 -0000
@@ -114,6 +114,7 @@
 	GladeXML *dialog = data;
 	GtkWidget *dlg;
 	gchar *filename, *path, *base;
+	gchar *themes_dir;
 	GList *src, *target;
 	GnomeVFSURI *src_uri;
 	const gchar *raw;
@@ -168,7 +169,8 @@
 		else
 			path = g_build_filename (g_get_home_dir (), ".themes", base, NULL);
 
-		if (access (path, X_OK | W_OK) != 0) {
+		themes_dir = g_build_filename (g_get_home_dir (), ".themes", NULL);
+		if (access (themes_dir, X_OK | W_OK) != 0) {
                         GtkWidget *dialog;
 
                         dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
@@ -177,9 +179,12 @@
                                                           _("Insufficient permissions to install the theme in:\n%s"), path);
 			gtk_dialog_run (GTK_DIALOG (dialog));
 			gtk_widget_destroy (dialog);
+			g_free (themes_dir);
 			return;
                 } 
 		
+		g_free (themes_dir);
+
 		/* To avoid the copy of /root/.themes to /root/.themes/.themes
 		 * which causes an infinite loop. The user asks to transfer the all
 		 * contents of a folder, to a folder under itseld. So ignore the
