[evolution-patches] patch for respecting system folder flags



the patch makes the front-end check for the system folder flag. 
-partha
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3600
diff -u -p -r1.3600 ChangeLog
--- ChangeLog	2 Mar 2005 05:23:45 -0000	1.3600
+++ ChangeLog	2 Mar 2005 10:13:56 -0000
@@ -1,3 +1,10 @@
+2005-03-02  Parthasarathi Susarla <sparthasarathi novell com>
+	
+	* em-folder-tree.c:
+	  (emft_popup_delete_folder),
+	  (emft_popup_rename_folder):
+	  respect the CAMEL_FOLDER_SYSTEM flag when set.
+
 2005-03-01  Not Zed  <NotZed Ximian com>
 
 	* message-list.c: include atkutil.h
Index: em-folder-tree.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-tree.c,v
retrieving revision 1.144
diff -u -p -r1.144 em-folder-tree.c
--- em-folder-tree.c	8 Feb 2005 05:07:42 -0000	1.144
+++ em-folder-tree.c	2 Mar 2005 10:13:56 -0000
@@ -2652,14 +2652,22 @@ emft_popup_delete_folder (EPopup *ep, EP
 	GtkTreeIter iter;
 	GtkWidget *dialog;
 	char *full_name;
+	guint32 flags = 0;
 	
 	selection = gtk_tree_view_get_selection (priv->treeview);
 	if (!emft_selection_get_selected (selection, &model, &iter))
 		return;
 	
 	gtk_tree_model_get (model, &iter, COL_POINTER_CAMEL_STORE, &store,
+			    COL_UINT_FLAGS, &flags,
 			    COL_STRING_FULL_NAME, &full_name, -1);
 	
+	if (flags & CAMEL_FOLDER_SYSTEM) {
+		e_error_run(NULL, "mail:no-delete-special-folder", full_name, NULL);
+		g_free (full_name);
+		return;
+	}
+	
 	local = mail_component_peek_local_store (NULL);
 	
 	if (store == local && is_special_local_folder (full_name)) {
@@ -2690,6 +2698,7 @@ emft_popup_rename_folder (EPopup *ep, EP
 	GtkTreeModel *model;
 	GtkTreeIter iter;
 	size_t base_len;
+	guint32 flags = 0;
 	
 	local = mail_component_peek_local_store (NULL);
 	
@@ -2699,8 +2708,17 @@ emft_popup_rename_folder (EPopup *ep, EP
 	
 	gtk_tree_model_get (model, &iter, COL_STRING_FULL_NAME, &full_name,
 			    COL_STRING_DISPLAY_NAME, &name,
+			    COL_UINT_FLAGS, &flags,
 			    COL_POINTER_CAMEL_STORE, &store,
 			    COL_STRING_URI, &uri, -1);
+	if (flags & CAMEL_FOLDER_SYSTEM) {
+		e_error_run((GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)emft),
+			    "mail:no-rename-special-folder", full_name, NULL);
+		g_free (full_name);
+		g_free (name);
+		g_free (uri);
+		return;
+	}
 	
 	/* don't allow user to rename one of the special local folders */
 	if (store == local && is_special_local_folder (full_name)) {


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