Same as maildir and mbox append-message.
authorJeffrey Stedfast <fejj@ximian.com>
Wed, 17 Oct 2001 22:23:29 +0000 (22:23 +0000)
committerJeffrey Stedfast <fejj@src.gnome.org>
Wed, 17 Oct 2001 22:23:29 +0000 (22:23 +0000)
2001-10-17  Jeffrey Stedfast  <fejj@ximian.com>

* providers/local/camel-mh-folder.c (mh_append_message): Same as
maildir and mbox append-message.

* providers/local/camel-maildir-folder.c (maildir_append_message):
Same as mbox append.

* camel-exception.c (camel_exception_set): Make sure the new
description isn't the same as the old description pointer before
freeing the old one.
(camel_exception_setv): Don't free the old description until we
set the new one this way we can reuse the old description in the
new description.

* providers/local/camel-mbox-folder.c (mbox_append_message): If
errno == EINTR, then we got a user-cancel so set the exception
appropriately so that we don't make the user shit his pants.

camel/ChangeLog
camel/providers/local/camel-maildir-folder.c
camel/providers/local/camel-mh-folder.c

index f3e5231..8a13bcc 100644 (file)
@@ -1,5 +1,11 @@
 2001-10-17  Jeffrey Stedfast  <fejj@ximian.com>
 
+       * providers/local/camel-mh-folder.c (mh_append_message): Same as
+       maildir and mbox append-message.
+
+       * providers/local/camel-maildir-folder.c (maildir_append_message):
+       Same as mbox append.
+
        * camel-exception.c (camel_exception_set): Make sure the new
        description isn't the same as the old description pointer before
        freeing the old one.
index bd7f879..48eb510 100644 (file)
@@ -177,9 +177,13 @@ maildir_append_message (CamelFolder *folder, CamelMimeMessage *message, const Ca
        camel_folder_summary_remove_uid (CAMEL_FOLDER_SUMMARY (folder->summary),
                                         camel_message_info_uid (mi));
        
-       camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
-                             _("Cannot append message to maildir folder: %s: %s"),
-                             name, g_strerror (errno));
+       if (errno == EINTR)
+               camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
+                                    _("Maildir append message cancelled"));
+       else
+               camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+                                     _("Cannot append message to maildir folder: %s: %s"),
+                                     name, g_strerror (errno));
        
        if (output_stream) {
                camel_object_unref (CAMEL_OBJECT (output_stream));
index cf9bc82..eb3cc8f 100644 (file)
@@ -168,9 +168,13 @@ mh_append_message (CamelFolder *folder, CamelMimeMessage *message, const CamelMe
        camel_folder_summary_remove_uid (CAMEL_FOLDER_SUMMARY (folder->summary),
                                         camel_message_info_uid (mi));
        
-       camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
-                             _("Cannot append message to mh folder: %s: %s"),
-                             name, g_strerror (errno));
+       if (errno == EINTR)
+               camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
+                                    _("MH append message cancelled"));
+       else
+               camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+                                     _("Cannot append message to mh folder: %s: %s"),
+                                     name, g_strerror (errno));
        
        if (output_stream) {
                camel_object_unref (CAMEL_OBJECT (output_stream));