Re: [evolution-patches] patch for 47545



Thank you, Jeffrey.

This time I attached a new patch.
In it, I fixed some code to the standards.

But I think this kind of attachment(dragged another message into the composer area) should have the filename same as the subject of the original message, or some other style of the original message's subject.

So I use this camel_mime_message_get_subject() to see if the mime_message has a subject. If it does have a subject, I think setting the filename as its subject is just ok. And if it doesn't have a subject, then the default filename of the mime_message is "attachment".

Or you mean some others?

Best Regards.
Charles


Jeffrey Stedfast wrote:

you don't want to set the subject as the attachment filename.

also, please adhere to our coding standards:

char *subject;

not

char* subject;

don't use {}'s if there is only one statement in the then-branch:

if (subject)
	camel_mime_part_set_filename (part, subject);

anyways, as I said above - I don't feel setting the filename as the
subject makes sense. A message/rfc822 attachment probably shouldn't even
have a filename...

Jeff

On Sat, 2003-12-13 at 05:17, Charles Zhang wrote:

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	15 Dec 2003 12:03:20 -0000
@@ -0,0 +0,5 @@
+2003-12-13  Charles Zhang  <charles zhang sun com>
+
+	*e-msg-composer.c (message_rfc822_dnd): set CamelMimePart filename.
+	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	15 Dec 2003 12:03:32 -0000
@@ -2540,18 +2540,25 @@ message_rfc822_dnd (EMsgComposer *compos
 	while (camel_mime_parser_step (mp, 0, 0) == HSCAN_FROM) {
 		CamelMimeMessage *message;
 		CamelMimePart *part;
+		char *subject;
 		
 		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);
+
 		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_content_type (part, "message/rfc822");
+
+		if (subject)
+			camel_mime_part_set_filename (part, subject);
+
 		e_msg_composer_attachment_bar_attach_mime_part (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar),
 								part);
 		camel_object_unref (message);


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