2006-03-16 [colin] 2.0.0cvs143
authorColin Leroy <colin@colino.net>
Thu, 16 Mar 2006 19:39:35 +0000 (19:39 +0000)
committerColin Leroy <colin@colino.net>
Thu, 16 Mar 2006 19:39:35 +0000 (19:39 +0000)
* src/compose.c
* src/compose.h
Fix the same stuff in compose

ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/compose.h

index 3c3e24a45579de400a039244d0501cc3766ed0da..86102fea5135031d828ba41e762968b6a50938ad 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-16 [colin]     2.0.0cvs143
+
+       * src/compose.c
+       * src/compose.h
+               Fix the same stuff in compose
+
 2006-03-16 [colin]     2.0.0cvs142
 
        * src/messageview.c
index 730ca35843b7fa147fff85f8852c2e7d4f954d59..782a6d4f6dd0cf36f5c8151fe608d62117e54450 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.34 -r 1.1.2.35 src/gtk/quicksearch.c;  cvs diff -u -r 1.395.2.181 -r 1.395.2.182 src/summaryview.c;  ) > 2.0.0cvs140.patchset
 ( cvs diff -u -r 1.150.2.57 -r 1.150.2.58 src/procmsg.c;  cvs diff -u -r 1.60.2.26 -r 1.60.2.27 src/procmsg.h;  cvs diff -u -r 1.213.2.85 -r 1.213.2.86 src/folder.c;  cvs diff -u -r 1.49.2.74 -r 1.49.2.75 src/procmime.c;  cvs diff -u -r 1.17.2.14 -r 1.17.2.15 src/procmime.h;  cvs diff -u -r 1.43.2.41 -r 1.43.2.42 src/toolbar.c;  cvs diff -u -r 1.94.2.80 -r 1.94.2.81 src/messageview.c;  cvs diff -u -r 1.19.2.7 -r 1.19.2.8 src/messageview.h;  ) > 2.0.0cvs141.patchset
 ( cvs diff -u -r 1.94.2.81 -r 1.94.2.82 src/messageview.c;  ) > 2.0.0cvs142.patchset
+( cvs diff -u -r 1.382.2.250 -r 1.382.2.251 src/compose.c;  cvs diff -u -r 1.50.2.22 -r 1.50.2.23 src/compose.h;  ) > 2.0.0cvs143.patchset
index f13d936c4e42acc976f9664bd5c4a262e990d8e2..ac984746e34e44ee0d25153bc459a8b86c6ff77d 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=142
+EXTRA_VERSION=143
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index c3d6833bfff0e20c8f41fe1fa6a73fbff65ba033..d6b456b5311730b5b0857c59b0c42c2d38bb4516 100644 (file)
@@ -1189,11 +1189,17 @@ static Compose *compose_generic_reply(MsgInfo *msginfo, gboolean quote,
        menu_set_active(ifactory, "/Options/Remove references", FALSE);
        menu_set_sensitive(ifactory, "/Options/Remove references", TRUE);
 
+       compose->updating = TRUE;
        compose->replyinfo = procmsg_msginfo_get_full_info(msginfo);
-
        if (!compose->replyinfo)
                compose->replyinfo = procmsg_msginfo_copy(msginfo);
-       
+       compose->updating = FALSE;
+
+       if (compose->deferred_destroy) {
+               compose_destroy(compose);
+               return NULL;
+       }
+
        compose_extract_original_charset(compose);
        
        if (msginfo->folder && msginfo->folder->ret_rcpt)
@@ -1292,9 +1298,16 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
 
        compose = compose_create(account, COMPOSE_FORWARD, batch);
 
+       compose->updating = TRUE;
        compose->fwdinfo = procmsg_msginfo_get_full_info(msginfo);
        if (!compose->fwdinfo)
                compose->fwdinfo = procmsg_msginfo_copy(msginfo);
+       compose->updating = FALSE;
+
+       if (compose->deferred_destroy) {
+               compose_destroy(compose);
+               return NULL;
+       }
 
        compose_extract_original_charset(compose);
 
@@ -1332,9 +1345,16 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo,
                gchar *qmark;
                MsgInfo *full_msginfo;
 
+               compose->updating = TRUE;
                full_msginfo = procmsg_msginfo_get_full_info(msginfo);
                if (!full_msginfo)
                        full_msginfo = procmsg_msginfo_copy(msginfo);
+               compose->updating = FALSE;
+
+               if (compose->deferred_destroy) {
+                       compose_destroy(compose);
+                       return NULL;
+               }
 
                if (prefs_common.fw_quotemark &&
                    *prefs_common.fw_quotemark)
@@ -1426,7 +1446,14 @@ Compose *compose_forward_multiple(PrefsAccount *account, GSList *msginfo_list)
        
        undo_block(compose->undostruct);
        for (msginfo = msginfo_list; msginfo != NULL; msginfo = msginfo->next) {
+               compose->updating = TRUE;
                msgfile = procmsg_get_message_file_path((MsgInfo *)msginfo->data);
+               compose->updating = FALSE;
+               if (compose->deferred_destroy) {
+                       compose_destroy(compose);
+                       g_free(msgfile);
+                       return NULL;
+               }
                if (!is_file_exist(msgfile))
                        g_warning("%s: file not exist\n", msgfile);
                else
@@ -1608,7 +1635,15 @@ void compose_reedit(MsgInfo *msginfo)
        } else {
                activate_privacy_system(compose, account, FALSE);
        }
+
+       compose->updating = TRUE;
        compose->targetinfo = procmsg_msginfo_copy(msginfo);
+       compose->updating = FALSE;
+       
+       if (compose->deferred_destroy) {
+               compose_destroy(compose);
+               return NULL;
+       }
 
        compose_extract_original_charset(compose);
 
@@ -1711,7 +1746,16 @@ Compose *compose_redirect(PrefsAccount *account, MsgInfo *msginfo,
 
        gtk_widget_grab_focus(compose->header_last->entry);
 
+       compose->updating = TRUE;
        filename = procmsg_get_message_file_path(msginfo);
+       compose->updating = FALSE;
+
+       if (compose->deferred_destroy) {
+               compose_destroy(compose);
+               g_free(filename);
+               return NULL;
+       }
+
        if (filename == NULL)
                return NULL;
 
@@ -6263,6 +6307,11 @@ static void compose_destroy(Compose *compose)
 {
        compose_list = g_list_remove(compose_list, compose);
 
+       if (compose->updating) {
+               debug_print("danger, not destroying anything now\n");
+               compose->deferred_destroy = TRUE;
+               return;
+       }
        /* NOTE: address_completion_end() does nothing with the window
         * however this may change. */
        address_completion_end(compose->window);
index 0e434501c6b47c527bdade01b25c9c29cb2995a4..29cce3410f55ec139f9a701fe9696e74cf8f7548 100644 (file)
@@ -224,6 +224,9 @@ struct _Compose
        GMutex *mutex;
        gchar *orig_charset;
        gint set_cursor_pos;
+       
+       gboolean updating;
+       gboolean deferred_destroy;
 };
 
 struct _AttachInfo