[evolution-patches] [mail] patch for 317284



Hi, 
this fixes the bug 317284
(http://bugzilla.gnome.org/show_bug.cgi?id=317284)

Does not add a header when there is no text.

Thanks,
partha
Index: em-mailer-prefs.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-mailer-prefs.c,v
retrieving revision 1.31
diff -u -p -r1.31 em-mailer-prefs.c
--- em-mailer-prefs.c	13 Jul 2005 10:38:07 -0000	1.31
+++ em-mailer-prefs.c	28 Sep 2005 18:30:19 -0000
@@ -384,19 +384,22 @@ emmp_header_add_header (GtkWidget *widge
 {
 	GtkTreeModel *model = GTK_TREE_MODEL (prefs->header_list_store);
 	GtkTreeIter iter;
-	
-	gtk_list_store_append (GTK_LIST_STORE (model), &iter);
-	gtk_list_store_set (GTK_LIST_STORE (model), &iter, 
-			    HEADER_LIST_NAME_COLUMN, gtk_entry_get_text (prefs->entry_header), 
-			    HEADER_LIST_ENABLED_COLUMN, TRUE, 
-			    HEADER_LIST_HEADER_COLUMN, gtk_entry_get_text (prefs->entry_header), 
-			    HEADER_LIST_IS_DEFAULT_COLUMN, FALSE, 
-			    -1);
-	gtk_entry_set_text (prefs->entry_header, "");
-	emmp_header_remove_sensitivity (prefs);
-	emmp_header_add_sensitivity (prefs);
-	
-	emmp_save_headers (prefs);
+	const gchar *text = gtk_entry_get_text (prefs->entry_header);
+
+	if (text && (strlen (text)>0)) {
+		gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+		gtk_list_store_set (GTK_LIST_STORE (model), &iter, 
+				HEADER_LIST_NAME_COLUMN, text, 
+				HEADER_LIST_ENABLED_COLUMN, TRUE, 
+				HEADER_LIST_HEADER_COLUMN, text, 
+				HEADER_LIST_IS_DEFAULT_COLUMN, FALSE, 
+				-1);
+		gtk_entry_set_text (prefs->entry_header, "");
+		emmp_header_remove_sensitivity (prefs);
+		emmp_header_add_sensitivity (prefs);
+
+		emmp_save_headers (prefs);
+	}
 }
 
 static void


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