--- /tmp/gnome-theme-save.c	2004-10-27 10:32:33.000000000 +0100
+++ gnome-theme-save.c	2005-09-27 21:26:04.000000000 +0100
@@ -80,7 +80,9 @@ setup_directory_structure (const gchar  
 			   GError      **error)
 {
   gchar *dir;
+  gchar *themepath;
   GnomeVFSURI *uri;
+  GnomeVFSURI *themeuri;
 
   dir = g_build_filename (g_get_home_dir (), ".themes", NULL);
   uri = gnome_vfs_uri_new (dir);
@@ -91,25 +93,32 @@ setup_directory_structure (const gchar  
   
   dir = g_build_filename (g_get_home_dir (), ".themes", theme_name, NULL);
   uri = gnome_vfs_uri_new (dir);
+  g_free (dir);
+
+  themepath = g_build_filename (g_get_home_dir (),
+    ".themes", theme_name, "index.theme", NULL);
+  themeuri = gnome_vfs_uri_new (themepath);
+  g_free (themepath);
+
   if (!gnome_vfs_uri_exists (uri))
     gnome_vfs_make_directory_for_uri (uri, 0775);
-  else {
-	GtkWidget *dialog;
-	gint response;
+  else if (gnome_vfs_uri_exists (themeuri) {
+    GtkWidget *dialog;
+    gint response;
 	  
-	dialog = gtk_message_dialog_new (NULL,
-			 GTK_DIALOG_MODAL,
-			 GTK_MESSAGE_QUESTION,
-	  		 GTK_BUTTONS_OK_CANCEL,
-	  		 _("The theme already exists. Would you like to replace it?"));
-	response = gtk_dialog_run(GTK_DIALOG(dialog));
-	gtk_widget_destroy(dialog);
-	if (response == GTK_RESPONSE_CANCEL) 
-		return FALSE;
+	  dialog = gtk_message_dialog_new (NULL,
+      GTK_DIALOG_MODAL,
+      GTK_MESSAGE_QUESTION,
+      GTK_BUTTONS_OK_CANCEL,
+      _("The theme already exists. Would you like to replace it?"));
+    response = gtk_dialog_run(GTK_DIALOG(dialog));
+    gtk_widget_destroy(dialog);
+    if (response == GTK_RESPONSE_CANCEL) 
+      return FALSE;
   }
 	  
   gnome_vfs_uri_unref (uri);
-  g_free (dir);
+  gnome_vfs_uri_unref (themeuri);
 
   return TRUE;
 }
