[evolution-patches] fix for bug #62665



I also fixed the spelling of an xml key name.

(also note: ::response doesn't take a guint, it takes int - hence that
change in case it wasn't obvious)

Jeff

-- 
Jeffrey Stedfast
Evolution Hacker - Novell, Inc.
fejj ximian com  - www.novell.com
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3446
diff -u -r1.3446 ChangeLog
--- ChangeLog	30 Aug 2004 18:55:34 -0000	1.3446
+++ ChangeLog	30 Aug 2004 19:18:51 -0000
@@ -1,3 +1,11 @@
+2004-08-30  Jeffrey Stedfast  <fejj novell com>
+
+	* em-folder-tree.c (emft_popup_delete_folder): Set the store and
+	full_name info on the dialog.
+	(emft_popup_delete_response): Use the requisite data stored on the
+	dialog object rather than examining the selection again. Fixes bug
+	#62665.
+
 2004-08-27  Not Zed  <NotZed Ximian com>
 
 	** See bug #63456.
Index: em-folder-tree.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-tree.c,v
retrieving revision 1.125
diff -u -r1.125 em-folder-tree.c
--- em-folder-tree.c	26 Aug 2004 15:05:48 -0000	1.125
+++ em-folder-tree.c	30 Aug 2004 19:18:52 -0000
@@ -2523,36 +2523,26 @@
 }
 
 static void
-emft_popup_delete_response (GtkWidget *dialog, guint response, EMFolderTree *emft)
+emft_popup_delete_response (GtkWidget *dialog, int response, EMFolderTree *emft)
 {
-	struct _EMFolderTreePrivate *priv = emft->priv;
-	GtkTreeSelection *selection;
-	GtkTreeModel *model;
 	CamelStore *store;
 	CamelException ex;
-	GtkTreeIter iter;
 	char *full_name;
 	
-	gtk_widget_destroy (dialog);
-	if (response != GTK_RESPONSE_OK)
-		return;
+	full_name = g_object_get_data ((GObject *) dialog, "full_name");
+	store = g_object_get_data ((GObject *) dialog, "store");
 	
-	selection = gtk_tree_view_get_selection (priv->treeview);
-	if (!emft_selection_get_selected (selection, &model, &iter))
-		return;
-	
-	gtk_tree_model_get (model, &iter, COL_STRING_FULL_NAME, &full_name,
-			    COL_POINTER_CAMEL_STORE, &store, -1);
-	
-	camel_exception_init (&ex);
-	emft_popup_delete_folders (store, full_name, &ex);
-	if (camel_exception_is_set (&ex)) {
-		e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
-			    "mail:no-delete-folder", full_name, ex.desc, NULL);
-		camel_exception_clear (&ex);
+	if (response == GTK_RESPONSE_OK) {
+		camel_exception_init (&ex);
+		emft_popup_delete_folders (store, full_name, &ex);
+		if (camel_exception_is_set (&ex)) {
+			e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
+				    "mail:no-delete-folder", full_name, ex.desc, NULL);
+			camel_exception_clear (&ex);
+		}
 	}
 	
-	g_free (full_name);
+	gtk_widget_destroy (dialog);
 }
 
 static void
@@ -2576,15 +2566,18 @@
 	local = mail_component_peek_local_store (NULL);
 	
 	if (store == local && is_special_local_folder (full_name)) {
-		e_error_run(NULL, "mail:no-delete-spethal-folder", full_name, NULL);
+		e_error_run(NULL, "mail:no-delete-special-folder", full_name, NULL);
 		return;
 	}
-
+	
+	camel_object_ref (store);
+	
 	dialog = e_error_new((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
 			     "mail:ask-delete-folder", full_name, NULL);
+	g_object_set_data_full ((GObject *) dialog, "full_name", full_name, g_free);
+	g_object_set_data_full ((GObject *) dialog, "store", store, camel_object_unref);
 	g_signal_connect (dialog, "response", G_CALLBACK (emft_popup_delete_response), emft);
 	gtk_widget_show (dialog);
-	g_free (full_name);
 }
 
 static void
@@ -2614,7 +2607,7 @@
 	/* don't allow user to rename one of the special local folders */
 	if (store == local && is_special_local_folder (full_name)) {
 		e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
-			    "mail:no-rename-spethal-folder", full_name, NULL);
+			    "mail:no-rename-special-folder", full_name, NULL);
 		g_free (full_name);
 		g_free (name);
 		g_free (uri);
Index: mail-errors.xml
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-errors.xml,v
retrieving revision 1.5
diff -u -r1.5 mail-errors.xml
--- mail-errors.xml	21 Aug 2004 06:55:07 -0000	1.5
+++ mail-errors.xml	30 Aug 2004 19:18:52 -0000
@@ -164,12 +164,12 @@
   <secondary>Because &quot;{1}&quot;.</secondary>
  </error>
 
- <error id="no-delete-spethal-folder" type="error">
+ <error id="no-delete-special-folder" type="error">
   <primary>Cannot delete system folder &quot;{0}&quot;.</primary>
   <secondary>System folders are required for Ximian Evolution to function correctly and cannot be renamed, moved, or deleted.</secondary>
  </error>
 
- <error id="no-rename-spethal-folder" type="error">
+ <error id="no-rename-special-folder" type="error">
   <primary>Cannot rename or move system folder &quot;{0}&quot;.</primary>
   <secondary>System folders are required for Ximian Evolution to function correctly and cannot be renamed, moved, or deleted.</secondary>
  </error>

Attachment: smime.p7s
Description: S/MIME cryptographic signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]