Re: [evolution-patches] patch for 47545



En? I cannot catch what you said well.
You mean that I shouldn't set a msg's filename, are you?
But this time I only set its description to get the correct display effect, is it ok for you?

Not Zed wrote:

This is wrong.

You're fixing the bug from the wrong end.� Mail messages should NOT have a filename set on them.� I doubt any other client sets a filename on message attachments.� e.g. what happens when you forward a message?

If you want to change the displayed name, it should just be in the display code.

Z


? composer/a.c
? composer/p.diff
Index: composer/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/composer/ChangeLog,v
retrieving revision 1.544.2.16
diff -u -p -r1.544.2.16 ChangeLog
--- composer/ChangeLog	6 Oct 2003 17:07:16 -0000	1.544.2.16
+++ composer/ChangeLog	22 Dec 2003 11:47:46 -0000
@@ -0,0 +0,5 @@
+2003-12-13  Charles Zhang  <charles zhang sun com>
+
+	*e-msg-composer.c (message_rfc822_dnd): set CamelMimePart description.
+	Fixes bug 47545.
+
Index: composer/e-msg-composer.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer.c,v
retrieving revision 1.395.2.8
diff -u -p -r1.395.2.8 e-msg-composer.c
--- composer/e-msg-composer.c	6 Oct 2003 17:07:16 -0000	1.395.2.8
+++ composer/e-msg-composer.c	22 Dec 2003 11:47:56 -0000
@@ -2540,23 +2540,34 @@ message_rfc822_dnd (EMsgComposer *compos
 	while (camel_mime_parser_step (mp, 0, 0) == HSCAN_FROM) {
 		CamelMimeMessage *message;
 		CamelMimePart *part;
+		const char *subject;
+		char *desc;
 		
 		message = camel_mime_message_new ();
 		if (camel_mime_part_construct_from_parser (CAMEL_MIME_PART (message), mp) == -1) {
 			camel_object_unref (message);
 			break;
 		}
-		
+
+		subject = camel_mime_message_get_subject (message);
+		if (subject)
+			desc = g_strdup_printf (_("Forwarded message - %s"), subject);
+		else
+			desc = g_strdup (_("Forwarded message"));
+
 		part = camel_mime_part_new ();
 		camel_mime_part_set_disposition (part, "inline");
 		camel_medium_set_content_object (CAMEL_MEDIUM (part),
 						 CAMEL_DATA_WRAPPER (message));
+		camel_mime_part_set_description (part, desc);
 		camel_mime_part_set_content_type (part, "message/rfc822");
+		g_free (desc);
+
 		e_msg_composer_attachment_bar_attach_mime_part (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar),
 								part);
 		camel_object_unref (message);
 		camel_object_unref (part);
-		
+
 		/* skip over the FROM_END state */
 		camel_mime_parser_step (mp, 0, 0);
 	}


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