2006-06-16 [colin] 2.3.0cvs18
authorColin Leroy <colin@colino.net>
Fri, 16 Jun 2006 16:30:03 +0000 (16:30 +0000)
committerColin Leroy <colin@colino.net>
Fri, 16 Jun 2006 16:30:03 +0000 (16:30 +0000)
* src/main.c
Instead of ignoring SIGPIPE, save caches
when getting one. Will fix the fact that
hot caches are out-of-date when logging
out of Xorg.
* src/compose.c
* src/prefs_compose_writing.c
Only save text (not attachments) when
auto-saving to drafts
* src/unmime.c
Always replace \n, \r and \t with spaces
in headers
* manual/dist/html/Makefile.am
* manual/dist/pdf/Makefile.am
* manual/dist/ps/Makefile.am
* manual/dist/txt/Makefile.am
* manual/fr/dist/html/Makefile.am
* manual/fr/dist/pdf/Makefile.am
* manual/fr/dist/ps/Makefile.am
* manual/fr/dist/txt/Makefile.am
* manual/pl/dist/html/Makefile.am
* manual/pl/dist/pdf/Makefile.am
* manual/pl/dist/ps/Makefile.am
* manual/pl/dist/txt/Makefile.am
Fix make clean removing pregenerated manuals

19 files changed:
ChangeLog
PATCHSETS
configure.ac
manual/dist/html/Makefile.am
manual/dist/pdf/Makefile.am
manual/dist/ps/Makefile.am
manual/dist/txt/Makefile.am
manual/fr/dist/html/Makefile.am
manual/fr/dist/pdf/Makefile.am
manual/fr/dist/ps/Makefile.am
manual/fr/dist/txt/Makefile.am
manual/pl/dist/html/Makefile.am
manual/pl/dist/pdf/Makefile.am
manual/pl/dist/ps/Makefile.am
manual/pl/dist/txt/Makefile.am
src/compose.c
src/main.c
src/prefs_compose_writing.c
src/unmime.c

index 87e1992..af342d4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+2006-06-16 [colin]     2.3.0cvs18
+
+       * src/main.c
+               Instead of ignoring SIGPIPE, save caches
+               when getting one. Will fix the fact that
+               hot caches are out-of-date when logging 
+               out of Xorg.
+       * src/compose.c
+       * src/prefs_compose_writing.c
+               Only save text (not attachments) when 
+               auto-saving to drafts
+       * src/unmime.c
+               Always replace \n, \r and \t with spaces
+               in headers
+       * manual/dist/html/Makefile.am
+       * manual/dist/pdf/Makefile.am
+       * manual/dist/ps/Makefile.am
+       * manual/dist/txt/Makefile.am
+       * manual/fr/dist/html/Makefile.am
+       * manual/fr/dist/pdf/Makefile.am
+       * manual/fr/dist/ps/Makefile.am
+       * manual/fr/dist/txt/Makefile.am
+       * manual/pl/dist/html/Makefile.am
+       * manual/pl/dist/pdf/Makefile.am
+       * manual/pl/dist/ps/Makefile.am
+       * manual/pl/dist/txt/Makefile.am
+               Fix make clean removing pregenerated manuals
+
+
 2006-06-16 [colin]     2.3.0cvs17
 
        * src/plugins/pgpcore/sgpgme.c
index 52aff61..4d777c1 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( diff -u /dev/null tools/make.themes.project;  ) > 2.3.0cvs15.patchset
 ( cvs diff -u -r 1.382.2.277 -r 1.382.2.278 src/compose.c;  cvs diff -u -r 1.207.2.103 -r 1.207.2.104 src/folderview.c;  cvs diff -u -r 1.28.2.17 -r 1.28.2.18 src/mbox.c;  cvs diff -u -r 1.94.2.87 -r 1.94.2.88 src/messageview.c;  cvs diff -u -r 1.10.2.8 -r 1.10.2.9 src/privacy.c;  cvs diff -u -r 1.10.2.7 -r 1.10.2.8 src/privacy.h;  cvs diff -u -r 1.49.2.77 -r 1.49.2.78 src/procmime.c;  cvs diff -u -r 1.150.2.68 -r 1.150.2.69 src/procmsg.c;  cvs diff -u -r 1.1.2.13 -r 1.1.2.14 src/plugins/pgpcore/passphrase.c;  cvs diff -u -r 1.1.2.18 -r 1.1.2.19 src/plugins/pgpcore/sgpgme.c;  cvs diff -u -r 1.1.2.12 -r 1.1.2.13 src/plugins/pgpinline/pgpinline.c;  cvs diff -u -r 1.1.2.34 -r 1.1.2.35 src/plugins/pgpmime/pgpmime.c;  ) > 2.3.0cvs16.patchset
 ( cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/plugins/pgpcore/sgpgme.c;  cvs diff -u -r 1.1.2.35 -r 1.1.2.36 src/plugins/pgpmime/pgpmime.c;  cvs diff -u -r 1.1.2.13 -r 1.1.2.14 src/plugins/pgpinline/pgpinline.c;  ) > 2.3.0cvs17.patchset
+( cvs diff -u -r 1.382.2.278 -r 1.382.2.279 src/compose.c;  cvs diff -u -r 1.115.2.90 -r 1.115.2.91 src/main.c;  cvs diff -u -r 1.1.2.7 -r 1.1.2.8 src/prefs_compose_writing.c;  cvs diff -u -r 1.8.2.8 -r 1.8.2.9 src/unmime.c;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 manual/dist/html/Makefile.am;  cvs diff -u -r 1.1.2.4 -r 1.1.2.5 manual/dist/pdf/Makefile.am;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 manual/dist/ps/Makefile.am;  cvs diff -u -r 1.1.2.3 -r 1.1.2.4 manual/dist/txt/Makefile.am;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/fr/dist/html/Makefile.am;  cvs diff -u -r 1.1.2.2 -r 1.1.2.3 manual/fr/dist/pdf/Makefile.am;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/fr/dist/ps/Makefile.am;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/fr/dist/txt/Makefile.am;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/pl/dist/html/Makefile.am;  cvs diff -u -r 1.1.2.2 -r 1.1.2.3 manual/pl/dist/pdf/Makefile.am;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/pl/dist/ps/Makefile.am;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 manual/pl/dist/txt/Makefile.am;  ) > 2.3.0cvs18.patchset
index b074bd9..0447386 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=3
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=17
+EXTRA_VERSION=18
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index bf51a6d..978fa6a 100644 (file)
@@ -18,5 +18,5 @@ sylpheed-claws-manual.html: \
        ../../sylpheed-claws-manual.xml 
        -docbook2html -u -o . ../../sylpheed-claws-manual.xml
        
-clean:
+maintainer-clean:
        -rm sylpheed-claws-manual.html
index 74a074c..6ffa3aa 100644 (file)
@@ -18,5 +18,5 @@ sylpheed-claws-manual.pdf: \
        ../../sylpheed-claws-manual.xml 
        -sh ../../xml2pdf ../../dtd/manual.xsl ../../sylpheed-claws-manual.xml
        
-clean:
+maintainer-clean:
        -rm sylpheed-claws-manual.pdf sylpheed-claws-manual.fo sylpheed-claws-manual.xsl
index d1b51b1..f958693 100644 (file)
@@ -18,5 +18,5 @@ sylpheed-claws-manual.ps: \
        ../../sylpheed-claws-manual.xml 
        -docbook2ps -o . ../../sylpheed-claws-manual.xml
        
-clean:
+maintainer-clean:
        -rm sylpheed-claws-manual.ps
index d5850ff..ecf0c32 100644 (file)
@@ -18,5 +18,5 @@ sylpheed-claws-manual.txt: \
        ../../sylpheed-claws-manual.xml 
        -docbook2txt -o . ../../sylpheed-claws-manual.xml
        
-clean:
+maintainer-clean:
        -rm sylpheed-claws-manual.txt
index eb799f2..5357117 100644 (file)
@@ -18,5 +18,5 @@ sylpheed-claws-manual.html: \
        ../../sylpheed-claws-manual.xml 
        -docbook2html -u -o . ../../sylpheed-claws-manual.xml
        
-clean:
+maintainer-clean:
        -rm sylpheed-claws-manual.html
index 64dec27..bc8a9f9 100644 (file)
@@ -18,5 +18,5 @@ sylpheed-claws-manual.pdf: \
        ../../sylpheed-claws-manual.xml 
        -sh ../../../xml2pdf ../../../dtd/manual.xsl ../../sylpheed-claws-manual.xml
        
-clean:
+maintainer-clean:
        -rm sylpheed-claws-manual.pdf sylpheed-claws-manual.fo sylpheed-claws-manual.xsl
index 2f8ff8e..acb3c8a 100644 (file)
@@ -18,5 +18,5 @@ sylpheed-claws-manual.ps: \
        ../../sylpheed-claws-manual.xml 
        -docbook2ps -o . ../../sylpheed-claws-manual.xml
        
-clean:
+maintainer-clean:
        -rm sylpheed-claws-manual.ps
index d370697..0373e92 100644 (file)
@@ -18,5 +18,5 @@ sylpheed-claws-manual.txt: \
        ../../sylpheed-claws-manual.xml 
        -docbook2txt -o . ../../sylpheed-claws-manual.xml
        
-clean:
+maintainer-clean:
        -rm sylpheed-claws-manual.txt
index 4aa4da7..cdb0fa3 100644 (file)
@@ -18,5 +18,5 @@ sylpheed-claws-manual.html: \
        ../../sylpheed-claws-manual.xml 
        -docbook2html -u -o . ../../sylpheed-claws-manual.xml
        
-clean:
+maintainer-clean:
        -rm sylpheed-claws-manual.html
index 8d90670..cf32b34 100644 (file)
@@ -18,5 +18,5 @@ sylpheed-claws-manual.pdf: \
        ../../sylpheed-claws-manual.xml 
        -sh ../../../xml2pdf ../../../dtd/manual.xsl ../../sylpheed-claws-manual.xml
        
-clean:
+maintainer-clean:
        -rm sylpheed-claws-manual.pdf sylpheed-claws-manual.fo sylpheed-claws-manual.xsl
index d63fe53..9d64152 100644 (file)
@@ -18,5 +18,5 @@ sylpheed-claws-manual.ps: \
        ../../sylpheed-claws-manual.xml 
        -docbook2ps -o . ../../sylpheed-claws-manual.xml
        
-clean:
+maintainer-clean:
        -rm sylpheed-claws-manual.ps
index 9321249..406acc1 100644 (file)
@@ -18,5 +18,5 @@ sylpheed-claws-manual.txt: \
        ../../sylpheed-claws-manual.xml 
        -docbook2txt -o . ../../sylpheed-claws-manual.xml
        
-clean:
+maintainer-clean:
        -rm sylpheed-claws-manual.txt
index f567ea2..2d79c61 100644 (file)
@@ -265,7 +265,8 @@ static gboolean compose_check_entries               (Compose        *compose,
                                                 gboolean       check_subject);
 static gint compose_write_to_file              (Compose        *compose,
                                                 FILE           *fp,
-                                                gint            action);
+                                                gint            action,
+                                                gboolean        attach_parts);
 static gint compose_write_body_to_file         (Compose        *compose,
                                                 const gchar    *file);
 static gint compose_remove_reedit_target       (Compose        *compose,
@@ -4338,7 +4339,7 @@ error:
        return -1;
 }
 
-static gint compose_write_to_file(Compose *compose, FILE *fp, gint action)
+static gint compose_write_to_file(Compose *compose, FILE *fp, gint action, gboolean attach_parts)
 {
        GtkTextBuffer *buffer;
        GtkTextIter start, end;
@@ -4349,6 +4350,9 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action)
        MimeInfo *mimemsg, *mimetext;
        gint line;
 
+       if (action == COMPOSE_WRITE_FOR_SEND)
+               attach_parts = TRUE;
+
        /* create message MimeInfo */
        mimemsg = procmime_mimeinfo_new();
         mimemsg->type = MIMETYPE_MESSAGE;
@@ -4495,7 +4499,7 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action)
                procmime_encode_content(mimetext, encoding);
 
        /* append attachment parts */
-       if (compose_use_attach(compose)) {
+       if (compose_use_attach(compose) && attach_parts) {
                MimeInfo *mimempart;
                gchar *boundary = NULL;
                mimempart = procmime_mimeinfo_new();
@@ -4812,7 +4816,7 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item,
                }
        } else {
                gint result = 0;
-               if ((result = compose_write_to_file(compose, fp, COMPOSE_WRITE_FOR_SEND)) < 0) {
+               if ((result = compose_write_to_file(compose, fp, COMPOSE_WRITE_FOR_SEND, TRUE)) < 0) {
                        lock = FALSE;
                        fclose(fp);
                        g_unlink(tmp);
@@ -7596,7 +7600,7 @@ static void compose_draft_cb(gpointer data, guint action, GtkWidget *widget)
        /* end of headers */
        fprintf(fp, "X-Sylpheed-End-Special-Headers: 1\n");
 
-       if (compose_write_to_file(compose, fp, COMPOSE_WRITE_FOR_STORE) < 0) {
+       if (compose_write_to_file(compose, fp, COMPOSE_WRITE_FOR_STORE, action != COMPOSE_AUTO_SAVE) < 0) {
                fclose(fp);
                g_unlink(tmp);
                g_free(tmp);
@@ -7632,7 +7636,7 @@ static void compose_draft_cb(gpointer data, guint action, GtkWidget *widget)
                        procmsg_msginfo_set_flags(newmsginfo, MSG_LOCKED, MSG_DRAFT);
                else
                        procmsg_msginfo_set_flags(newmsginfo, 0, MSG_DRAFT);
-               if (compose_use_attach(compose))
+               if (compose_use_attach(compose) && action != COMPOSE_AUTO_SAVE)
                        procmsg_msginfo_set_flags(newmsginfo, 0,
                                                  MSG_HAS_ATTACHMENT);
 
index bf89c0e..db35939 100644 (file)
@@ -505,10 +505,6 @@ int main(int argc, char *argv[])
 
        inc_autocheck_timer_init(mainwin);
 
-       /* ignore SIGPIPE signal for preventing sudden death of program */
-#ifdef G_OS_UNIX
-       signal(SIGPIPE, SIG_IGN);
-#endif
        if (cmd.online_mode == ONLINE_MODE_OFFLINE) {
                main_window_toggle_work_offline(mainwin, TRUE, FALSE);
        }
@@ -601,14 +597,18 @@ int main(int argc, char *argv[])
 
 static void save_all_caches(FolderItem *item, gpointer data)
 {
+       gint free_caches = GPOINTER_TO_INT(data);
        if (!item->cache) {
                return;
        }
 
        if (item->opened)
                folder_item_close(item);
-
-       folder_item_free_cache(item, TRUE);
+       
+       if (free_caches)
+               folder_item_free_cache(item, TRUE);
+       else
+               folder_item_write_cache(item);
 }
 
 static void exit_sylpheed(MainWindow *mainwin)
@@ -632,7 +632,7 @@ static void exit_sylpheed(MainWindow *mainwin)
 
        /* save all state before exiting */
        folder_write_list();
-       folder_func_to_all_folders(save_all_caches, NULL);
+       folder_func_to_all_folders(save_all_caches, GINT_TO_POINTER(1));
 
        main_window_get_size(mainwin);
        main_window_get_position(mainwin);
@@ -1246,6 +1246,14 @@ static void send_queue(void)
 
 static void quit_signal_handler(int sig)
 {
+#ifdef SIGPIPE
+       if (sig == SIGPIPE) {
+               debug_print("caugth SIGPIPE, maybe X closing!\n");
+               folder_write_list();
+               folder_func_to_all_folders(save_all_caches, GINT_TO_POINTER(0));
+               return; 
+       }
+#endif
        debug_print("Quitting on signal %d\n", sig);
 
        g_timeout_add(0, clean_quit, NULL);
@@ -1268,6 +1276,9 @@ static void install_basic_sighandlers()
 #ifdef SIGHUP
        sigaddset(&mask, SIGHUP);
 #endif
+#ifdef SIGPIPE
+       sigaddset(&mask, SIGPIPE);
+#endif
 
        act.sa_handler = quit_signal_handler;
        act.sa_mask    = mask;
@@ -1282,6 +1293,9 @@ static void install_basic_sighandlers()
 #ifdef SIGHUP
        sigaction(SIGHUP, &act, 0);
 #endif 
+#ifdef SIGPIPE
+       sigaction(SIGPIPE, &act, 0);
+#endif 
 
        sigprocmask(SIG_UNBLOCK, &mask, 0);
 #endif /* !G_OS_WIN32 */
index cfee933..dd48d1f 100644 (file)
@@ -137,7 +137,7 @@ void prefs_compose_writing_create_widget(PrefsPage *_page, GtkWindow *window,
        gtk_box_pack_start (GTK_BOX (vbox2), hbox_autosave, FALSE, FALSE, 0);
 
        PACK_CHECK_BUTTON (hbox_autosave, checkbtn_autosave,
-                          _("Autosave to Drafts folder every"));
+                          _("Autosave message text to Drafts folder every"));
 
        spinbtn_autosave_adj = gtk_adjustment_new (50, 0, 1000, 1, 10, 10);
        spinbtn_autosave_length = gtk_spin_button_new
index f20a83c..e61818e 100644 (file)
@@ -132,6 +132,14 @@ gchar *unmime_header(const gchar *encoded_str)
        out_str = outbuf->str;
        out_len = outbuf->len;
        g_string_free(outbuf, FALSE);
+       if (out_str) {
+               while (strchr(out_str, '\n'))
+                       *strchr(out_str, '\n') = ' ';
+               while (strchr(out_str, '\r'))
+                       *strchr(out_str, '\r') = ' ';
+               while (strchr(out_str, '\t'))
+                       *strchr(out_str, '\t') = ' ';
+       }
 
        return g_realloc(out_str, out_len + 1);
 }