sync with sylpheed 0.7.3cvs4
authorPaul Mangan <paul@claws-mail.org>
Thu, 7 Mar 2002 13:22:39 +0000 (13:22 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 7 Mar 2002 13:22:39 +0000 (13:22 +0000)
23 files changed:
ChangeLog
ChangeLog.claws
ChangeLog.jp
INSTALL
INSTALL.jp
configure.in
libkcc/jis.c
src/addrcache.c
src/addritem.c
src/folder.c
src/folderview.c
src/inc.c
src/inc.h
src/ldif.c
src/logwindow.c
src/mainwindow.c
src/mgutils.c
src/mimeview.c
src/prefs_common.c
src/rfc2015.c
src/send.c
src/session.c
src/textview.c

index b7ad4ee6f4f16adc4f941690ceb182e87fa5168e..42f083aeadbe1291cc4ef2c702fa5c688553acf5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,38 @@
+2002-03-07
+
+       * manual/en/sylpheed*.html: updated to the latest version.
+       * libkcc/jis.c
+         src/addrcache.c
+         src/addritem.c
+         src/ldif.c
+         src/mgutils.c: include string.h to remove warning about strlen()
+         etc.
+       * src/folder.c
+         src/folderview.c
+         src/inc.c
+         src/logwindow.c
+         src/mainwindow.c
+         src/mimeview.c
+         src/prefs.c
+         src/prefs_common.c
+         src/procheader.c
+         src/send.c
+         src/session.c
+         src/sigstatus.c
+         src/summaryview.c: added break to the last label of switch to
+         prevent the 'deprecated use of label at end of compound statement'
+         warning at gcc-3.0.
+       * src/rfc2015.c: passphrase_cb(): fixed the type of r_hd.
+
+2002-03-06
+
+       * src/inc.[ch]: preserve the pointer to IncProgressDialog to the
+         static list.
+         inc_cancel_all(): new. It cancels the all current incorporation.
+       * src/mainwindow.c: added 'Cancel receiving' menu.
+       * src/textview.c: a minor fix for single-part MIME messages, and
+         a bit of cleanup for textview_write_body().
+
 2002-03-05
 
        * src/inc.c: inc_write_uidl_list(): fixed a bug that lost UIDL
index 02f51e267ffa283b5138a4bc7b7504a7a5c4c6b2..3079b5882e5747bec43454454aaa1b31bf507234 100644 (file)
@@ -1,3 +1,8 @@
+2002-03-07 [paul]      0.7.3claws1
+
+       * sync with sylpheed 0.7.3cvs4
+               see ChangeLog entries  2002-03-06 and 2002-03-07
+
 2002-03-07 [melvin]    0.7.2claws34
 
        * src/selective_download.c
index 1d275c7a766334f98ae4ea796e21390742e9b6f6..b19f2715d1a0d19ca7f665d3da0ef4c454dc4d08 100644 (file)
@@ -1,3 +1,38 @@
+2002-03-07
+
+       * manual/en/sylpheed*.html: ºÇ¿·ÈǤ˹¹¿·¡£
+       * libkcc/jis.c
+         src/addrcache.c
+         src/addritem.c
+         src/ldif.c
+         src/mgutils.c: string.h ¤ò include ¤·¤Æ strlen() Åù¤Î warning
+         ¤ò¼è¤ê½ü¤¤¤¿¡£
+       * src/folder.c
+         src/folderview.c
+         src/inc.c
+         src/logwindow.c
+         src/mainwindow.c
+         src/mimeview.c
+         src/prefs.c
+         src/prefs_common.c
+         src/procheader.c
+         src/send.c
+         src/session.c
+         src/sigstatus.c
+         src/summaryview.c: gcc-3.0 ¤Ç 'deprecated use of label at end of
+         compound statement' ¤Î warning ¤òÈò¤±¤ë¤¿¤á¤Ë switch ¤ÎºÇ¸å¤Î
+         ¥é¥Ù¥ë¤Ë break ¤òÄɲá£
+       * src/rfc2015.c: passphrase_cb(): r_hd ¤Î·¿¤ò½¤Àµ¡£
+
+2002-03-06
+
+       * src/inc.[ch]: IncProgressDialog ¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÀÅŪ¤Ê¥ê¥¹¥È¤Ë
+         Êݸ¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+         inc_cancel_all(): ¿·µ¬¡£Á´¤Æ¤Î¸½ºß¤Î¼õ¿®¤ò¥­¥ã¥ó¥»¥ë¤¹¤ë¡£
+       * src/mainwindow.c: ¡Ö¼õ¿®¤òÃæ»ß¡×¥á¥Ë¥å¡¼¤òÄɲá£
+       * src/textview.c: ¥·¥ó¥°¥ë¥Ñ¡¼¥È MIME ¥á¥Ã¥»¡¼¥¸¤Î¤¿¤á¤Î¥Þ¥¤¥Ê¡¼
+         ¤Ê½¤Àµ¤È¡¢ textview_write_body() ¤ò¾¯¤·À°Íý¡£
+
 2002-03-05
 
        * src/inc.c: inc_write_uidl_list(): UIDL ¥³¥Þ¥ó¥É¤òȯ¹Ô¤¹¤ëÁ°¤Ë
diff --git a/INSTALL b/INSTALL
index 1434f30470cdb96c04113166ef140f47b2eec8f1..17df779d804229fe9c2185e867a850187cc011a7 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -66,10 +66,12 @@ o Caldera OpenDesktop 2.4
 o Caldera Workstation 3.1
 o Conectiva Linux 4.0
 o Conectiva Linux 5.0
+o Conectiva Linux 7.0
 o Vector Linux 1.5
 o Yellow Dog Linux 2.0 (glibc 2.2.1)
 o Yellow Dog Linux 2.1 (PowerPC)
 o ASP Linux 7.2 (glibc 2.2.4)
+o Redmond Linux (Lycoris)
 
 BSD
 
@@ -106,16 +108,20 @@ o HP-UX 11.0
 o HP-UX 11i
 o Tru64 Unix 5.0 (OSF1 V5.0)
 o SCO UnixWare 7
-o Mac OS X 10.1.2 (Darwin 5.2) + XDarwin (has locale problem)
+o Mac OS X 10.1.3 (Darwin 5.3) + XDarwin (without XLocale support) + libxpg4
 
 Others
 
-o Windows (cygwin + GTK+ for win32) (unstable)
+o Windows (cygwin + GTK+ for win32) (in progress)
 
 Build it
 ========
 
-For installation, just type:
+Please make sure that gtk-devel and glib-devel (or similar) packages are
+installed before the compilation (you may also require flex (lex) and bison
+(yacc)).
+
+To compile and install, just type:
 
 % ./configure
 % make
index babd1780ecdddb46bc4967488f4d398725827a5b..7f5c4b8944705f85d09ec862e405d544489dfb70 100644 (file)
@@ -65,10 +65,12 @@ o Caldera OpenDesktop 2.4
 o Caldera Workstation 3.1
 o Conectiva Linux 4.0
 o Conectiva Linux 5.0
+o Conectiva Linux 7.0
 o Vector Linux 1.5
 o Yellow Dog Linux 2.0 (glibc 2.2.1)
 o Yellow Dog Linux 2.1 (PowerPC)
 o ASP Linux 7.2 (glibc 2.2.4)
+o Redmond Linux (Lycoris)
 
 BSD
 
@@ -105,16 +107,20 @@ o HP-UX 11.0
 o HP-UX 11i
 o Tru64 Unix 5.0 (OSF1 V5.0)
 o SCO UnixWare 7
-o Mac OS X 10.1.2 (Darwin 5.2) + XDarwin (locale ¤ËÌäÂꤢ¤ê)
+o Mac OS X 10.1.3 (Darwin 5.3) + XDarwin (XLocale Ìµ¤·) + libxpg4
 
 ¤½¤Î¾
 
-o Windows (cygwin + GTK+ for win32) (unstable)
+o Windows (cygwin + GTK+ for win32) (³«È¯Ãæ)
 
 ¥Ó¥ë¥É
 ======
 
-¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤ËÆþÎϤ·¤Æ¤¯¤À¤µ¤¤:
+¥³¥ó¥Ñ¥¤¥ëÁ°¤Ë gtk-devel ¤È glib-devel (¤¢¤ë¤¤¤ÏÁêÅö¤¹¤ë)¥Ñ¥Ã¥±¡¼¥¸¤¬
+¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤(flex (lex) ¤È bison (yacc)
+¤âɬÍפ«¤â¤·¤ì¤Þ¤»¤ó)¡£
+
+¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤ËÆþÎϤ·¤Æ¤¯¤À¤µ¤¤:
 
 % ./configure
 % make
index a316217c70a007f7ae4b3eef02da65432c719976..c3ec11476cdae801158a05a981898c6144c35efa 100644 (file)
@@ -5,10 +5,10 @@ PACKAGE=sylpheed
 dnl version number
 MAJOR_VERSION=0
 MINOR_VERSION=7
-MICRO_VERSION=2
+MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws34
+EXTRA_VERSION=claws1
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 187dfeb4b75b8ec6e5e8e3367914b276bed1b109..7863ffffb7845c04926f410490f6524e03507378 100644 (file)
@@ -1,5 +1,7 @@
 #include "libkcc.h"
 
+#include <string.h>
+
 extern enum mode outmode;
 extern char shiftout[], shiftin[];
 extern bool nogaiji;
index dad38740695851d4e2145450b42b6b463d73cc36..e692754d79e6a11c3f7fa5021eba2cf98393388e 100644 (file)
  * Functions to maintain address cache.
  */
 
+#include <glib.h>
 #include <stdio.h>
+#include <string.h>
 #include <sys/stat.h>
-#include <glib.h>
 
 #include "mgutils.h"
 #include "addritem.h"
index 1a83413c0413ffdfbf89d6e2c1864d5c5b9f5e2f..0f12f241ce07878c0678de0140011c2b14089607 100644 (file)
@@ -21,8 +21,9 @@
  * General primitive address item objects.
  */
 
-#include <stdio.h>
 #include <glib.h>
+#include <stdio.h>
+#include <string.h>
 
 #include "addritem.h"
 #include "mgutils.h"
index 31f702aa62e43b76c6c03196b4b6dcf8d207513d..912ff907b6b89f8c78c0db15f8832c18d7df8c07 100644 (file)
@@ -1059,8 +1059,7 @@ static gboolean folder_build_tree(GNode *node, gpointer data)
        case F_DRAFT:  folder->draft  = item; break;
        case F_QUEUE:  folder->queue  = item; break;
        case F_TRASH:  folder->trash  = item; break;
-       default:
-               break;
+       default:       break;
        }
 
        prefs_folder_item_read_config(item);
index 7b73f45bc9d7418f01167a24b7f5a57fccbe63e0..61d4f403f73c6b34e50329559968f8db12e1cf59 100644 (file)
@@ -1665,6 +1665,7 @@ static void folderview_col_resized(GtkCList *clist, gint column, gint width,
                prefs_common.folder_col_total = width;
                break;
        default:
+               break;
        }
 }
 
index 8a20a276022f634e2bdea03de207c4621556b893..f15928bab9ac2f6f9eb2db7d6a2861087a08ed6a 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -66,6 +66,8 @@
 #include "filtering.h"
 #include "selective_download.h"
 
+static GList *inc_dialog_list = NULL;
+
 static guint inc_lock_count = 0;
 
 static GdkPixmap *currentxpm;
@@ -104,7 +106,7 @@ static gboolean inc_pop3_recv_func  (SockInfo       *sock,
 
 static void inc_put_error              (IncState        istate);
 
-static void inc_cancel                 (GtkWidget      *widget,
+static void inc_cancel_cb              (GtkWidget      *widget,
                                         gpointer        data);
 
 static gint inc_spool                  (void);
@@ -226,6 +228,9 @@ static gint inc_account_mail(PrefsAccount *account, MainWindow *mainwin)
        text[2] = _("Standby");
        gtk_clist_append(GTK_CLIST(inc_dialog->dialog->clist), text);
 
+       main_window_set_toolbar_sensitive(mainwin);
+       main_window_set_menu_sensitive(mainwin);
+
        return inc_start(inc_dialog);
 }
 
@@ -296,6 +301,9 @@ void inc_all_account_mail(MainWindow *mainwin, gboolean notify)
                gtk_clist_append(GTK_CLIST(inc_dialog->dialog->clist), text);
        }
 
+       main_window_set_toolbar_sensitive(mainwin);
+       main_window_set_menu_sensitive(mainwin);
+
        new_msgs += inc_start(inc_dialog);
 
        inc_finished(mainwin, new_msgs > 0);
@@ -315,7 +323,7 @@ static IncProgressDialog *inc_progress_dialog_create(void)
        gtk_window_set_title(GTK_WINDOW(progress->window),
                             _("Retrieving new messages"));
        gtk_signal_connect(GTK_OBJECT(progress->cancel_btn), "clicked",
-                          GTK_SIGNAL_FUNC(inc_cancel), dialog);
+                          GTK_SIGNAL_FUNC(inc_cancel_cb), dialog);
        gtk_signal_connect(GTK_OBJECT(progress->window), "delete_event",
                           GTK_SIGNAL_FUNC(gtk_true), NULL);
        /* manage_window_set_transient(GTK_WINDOW(progress->window)); */
@@ -339,6 +347,8 @@ static IncProgressDialog *inc_progress_dialog_create(void)
        dialog->dialog = progress;
        dialog->queue_list = NULL;
 
+       inc_dialog_list = g_list_append(inc_dialog_list, dialog);
+
        return dialog;
 }
 
@@ -354,6 +364,8 @@ static void inc_progress_dialog_destroy(IncProgressDialog *inc_dialog)
 {
        g_return_if_fail(inc_dialog != NULL);
 
+       inc_dialog_list = g_list_remove(inc_dialog_list, inc_dialog);
+
        gtk_progress_bar_update
                (GTK_PROGRESS_BAR(inc_dialog->mainwin->progressbar), 0.0);
        progress_dialog_destroy(inc_dialog->dialog);
@@ -992,11 +1004,15 @@ static void inc_put_error(IncState istate)
        }
 }
 
-static void inc_cancel(GtkWidget *widget, gpointer data)
+static void inc_cancel(IncProgressDialog *dialog)
 {
-       IncProgressDialog *dialog = data;
-       IncSession *session = dialog->queue_list->data;
-       SockInfo *sockinfo = session->pop3_state->sockinfo;
+       IncSession *session;
+       SockInfo *sockinfo;
+
+       g_return_if_fail(dialog != NULL);
+
+       session = dialog->queue_list->data;
+       sockinfo = session->pop3_state->sockinfo;
 
        if (!sockinfo || session->atm->terminated == TRUE) return;
 
@@ -1005,6 +1021,24 @@ static void inc_cancel(GtkWidget *widget, gpointer data)
        session->pop3_state->sockinfo = NULL;
 }
 
+gboolean inc_is_active(void)
+{
+       return (inc_dialog_list != NULL);
+}
+
+void inc_cancel_all(void)
+{
+       GList *cur;
+
+       for (cur = inc_dialog_list; cur != NULL; cur = cur->next)
+               inc_cancel((IncProgressDialog *)cur->data);
+}
+
+static void inc_cancel_cb(GtkWidget *widget, gpointer data)
+{
+       inc_cancel((IncProgressDialog *)data);
+}
+
 static gint inc_spool(void)
 {
        gchar *mbox, *logname;
index 184f0fcd0ecfea478562ce2bb392da14bec9b462..6da9fc8188f28e7adc8ea69a5b57602552a7cf1a 100644 (file)
--- a/src/inc.h
+++ b/src/inc.h
@@ -111,6 +111,10 @@ void inc_progress_update   (Pop3State      *state,
 gint inc_drop_message          (const gchar    *file,
                                 Pop3State      *state);
 
+gboolean inc_is_active         (void);
+
+void inc_cancel_all            (void);
+
 void inc_lock                  (void);
 void inc_unlock                        (void);
 
index 612608d90c8c4ce4c8ee656ce6a97b1c6f9012ff..f8b48627830d2679a3de1d44e61470b1f33752d1 100644 (file)
@@ -22,8 +22,9 @@
  * files).
  */
 
-#include <sys/stat.h>
 #include <glib.h>
+#include <string.h>
+#include <sys/stat.h>
 
 #include "mgutils.h"
 #include "ldif.h"
index 956ba0af3f30d05a86b4bcc57f7de6cbc0126d38..8f45bdeba3bd36b527e17eb3869fd1b16ca701b8 100644 (file)
@@ -142,6 +142,7 @@ void log_window_append(const gchar *str, LogType type)
                color = &logwindow->msg_color;
                break;
        default:
+               break;
        }
 
        if (head) gtk_text_insert(text, NULL, color, NULL, head, -1);
index f27859a042a7c95c68f53c4e2b962edaaf4a976d..335d55e435ae8fc2e18b489ad8b2ee33c0dd1e7a 100644 (file)
@@ -262,6 +262,9 @@ static void inc_mail_cb                     (MainWindow     *mainwin,
 static void inc_all_account_mail_cb    (MainWindow     *mainwin,
                                         guint           action,
                                         GtkWidget      *widget);
+static void inc_cancel_cb              (MainWindow     *mainwin,
+                                        guint           action,
+                                        GtkWidget      *widget);
 
 static void send_queue_cb              (MainWindow     *mainwin,
                                         guint           action,
@@ -632,9 +635,9 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_Message/Get new ma_il"),         "<control>I",   inc_mail_cb, 0, NULL},
        {N_("/_Message/Get from _all accounts"),
                                                "<shift><control>I", inc_all_account_mail_cb, 0, NULL},
+       {N_("/_Message/Cancel receivin_g"),     NULL, inc_cancel_cb, 0, NULL},
        {N_("/_Message/---"),                   NULL, NULL, 0, "<Separator>"},
-       {N_("/_Message/Send queued messa_ges"),
-                                               NULL, send_queue_cb, 0, NULL},
+       {N_("/_Message/_Send queued messages"), NULL, send_queue_cb, 0, NULL},
        {N_("/_Message/---"),                   NULL, NULL, 0, "<Separator>"},
        {N_("/_Message/Compose a_n email message"),     "<control>M", compose_mail_cb, 0, NULL},
        {N_("/_Message/Compose a news message"),        NULL,   compose_news_cb, 0, NULL},
@@ -1413,9 +1416,10 @@ typedef enum
        M_THREADED            = 1 << 7,
        M_UNTHREADED          = 1 << 8,
        M_ALLOW_DELETE        = 1 << 9,
-       M_NEWS                = 1 << 10,
-       M_HAVE_NEWS_ACCOUNT   = 1 << 11,
-       M_HIDE_READ_MSG       = 1 << 12
+       M_INC_ACTIVE          = 1 << 10,
+       M_NEWS                = 1 << 11,
+       M_HAVE_NEWS_ACCOUNT   = 1 << 12,
+       M_HIDE_READ_MSG       = 1 << 13
 } SensitiveCond;
 
 static SensitiveCond main_window_get_current_state(MainWindow *mainwin)
@@ -1467,6 +1471,9 @@ static SensitiveCond main_window_get_current_state(MainWindow *mainwin)
                }
        }
 
+       if (inc_is_active())
+               state |= M_INC_ACTIVE;
+
        return state;
 }
 
@@ -1563,6 +1570,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
 
                {"/Message/Get new mail"          , M_HAVE_ACCOUNT|M_UNLOCKED},
                {"/Message/Get from all accounts" , M_HAVE_ACCOUNT|M_UNLOCKED},
+               {"/Message/Cancel receiving"      , M_INC_ACTIVE},
                {"/Message/Compose a news message", M_HAVE_NEWS_ACCOUNT},
                {"/Message/Reply"                 , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
                {"/Message/Reply to sender"       , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},
@@ -2548,6 +2556,11 @@ static void inc_all_account_mail_cb(MainWindow *mainwin, guint action,
        inc_all_account_mail(mainwin, prefs_common.newmail_notify_manu);
 }
 
+static void inc_cancel_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
+{
+       inc_cancel_all();
+}
+
 static void send_queue_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
 {
        GList *list;
index d3b99c165162cdee22c1a176959a05e12f620696..f5fd3dcaf99f15137e14d1ac3ca4cbfa729f005a 100644 (file)
@@ -21,8 +21,9 @@
  * General functions for create common address book entries.
  */
 
-#include <stdio.h>
 #include <glib.h>
+#include <stdio.h>
+#include <string.h>
 
 #include "mgutils.h"
 
index a99a5e8a849fbea4eff7090db4775e2e16759cd2..34b311dcb78e8d46c265f614d0b43fca531e0941 100644 (file)
@@ -715,6 +715,7 @@ static gint mimeview_key_pressed(GtkWidget *widget, GdkEventKey *event,
                mimeview_launch(mimeview);
                return TRUE;
        default:
+               break;
        }
 
        if (!mimeview->messageview->mainwin) return FALSE;
index d823904ff5fc1acce6f3288d2b8de9e9221494ef..d0cd3c037c6f78950200377e172817bdbc2fcfd6 100644 (file)
@@ -3886,6 +3886,7 @@ static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam)
                gtk_option_menu_set_history(optmenu, 2);
                break;
        default:
+               break;
        }
 
        menu = gtk_option_menu_get_menu(optmenu);
index 9edc40c6c743de463af4705b04aedc76be7ffd48..a285c7d638338f5250c1c6140dd9efe98bb0cbce 100644 (file)
@@ -336,14 +336,14 @@ leave:
 }
 
 static const char *
-passphrase_cb (void *opaque, const char *desc, void *r_hd)
+passphrase_cb (void *opaque, const char *desc, void **r_hd)
 {
     struct passphrase_cb_info_s *info = opaque;
     GpgmeCtx ctx = info ? info->c : NULL;
     const char *pass;
 
     if (!desc) {
-        /* FIXME: cleanup by looking at *r_hd */
+        /* FIXME: cleanup by looking at **r_hd */
         return NULL;
     }
 
index d85cc2e24bcf80878818b866591fc9b364df4451..bb764a6d022ddaf233140da8d1132dc0f85ffc24 100644 (file)
@@ -152,6 +152,7 @@ gint send_message_queue(const gchar *file)
                        ac = account_find_from_id(atoi(p));
                        break;
                default:
+                       break;
                }
        }
 
index 316e45650360e39982add2d757f39b7c5e561fe9..bf4ae4fdc74ae253f3a395fbf4b218179d64b1f7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2002 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
index 8695f2d2b96e134c4db6e68009fcfbc1b5d215d9..b5bec13ed078b9ea40d511e3d3a18efe0f551292 100644 (file)
@@ -118,7 +118,7 @@ static void textview_add_part               (TextView       *textview,
 static void textview_write_body                (TextView       *textview,
                                         MimeInfo       *mimeinfo,
                                         FILE           *fp,
-                                        CodeConverter  *conv);
+                                        const gchar    *charset);
 static void textview_show_html         (TextView       *textview,
                                         FILE           *fp,
                                         CodeConverter  *conv);
@@ -345,7 +345,6 @@ void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
        gint boundary_len = 0;
        const gchar *charset = NULL;
        GPtrArray *headers = NULL;
-       CodeConverter *conv;
 
        g_return_if_fail(mimeinfo != NULL);
        g_return_if_fail(fp != NULL);
@@ -425,9 +424,7 @@ void textview_show_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
                textview->body_pos = gtk_stext_get_length(text);
        }
 
-       conv = conv_code_converter_new(charset);
-       textview_write_body(textview, mimeinfo, fp, conv);
-       conv_code_converter_destroy(conv);
+       textview_write_body(textview, mimeinfo, fp, charset);
 
        gtk_stext_thaw(text);
 }
@@ -440,13 +437,18 @@ static void textview_add_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
        gint boundary_len = 0;
        const gchar *charset = NULL;
        GPtrArray *headers = NULL;
-       CodeConverter *conv;
 
        g_return_if_fail(mimeinfo != NULL);
        g_return_if_fail(fp != NULL);
 
        if (mimeinfo->mime_type == MIME_MULTIPART) return;
 
+       if (!mimeinfo->parent &&
+           mimeinfo->mime_type != MIME_TEXT &&
+           mimeinfo->mime_type != MIME_TEXT_HTML &&
+           mimeinfo->mime_type != MIME_TEXT_ENRICHED)
+               return;
+
        if (fseek(fp, mimeinfo->fpos, SEEK_SET) < 0) {
                perror("fseek");
                return;
@@ -496,9 +498,7 @@ static void textview_add_part(TextView *textview, MimeInfo *mimeinfo, FILE *fp)
                        charset = prefs_common.force_charset;
                else if (mimeinfo->charset)
                        charset = mimeinfo->charset;
-               conv = conv_code_converter_new(charset);
-               textview_write_body(textview, mimeinfo, fp, conv);
-               conv_code_converter_destroy(conv);
+               textview_write_body(textview, mimeinfo, fp, charset);
        }
 
        gtk_stext_thaw(text);
@@ -562,10 +562,13 @@ void textview_show_signature_part(TextView *textview, MimeInfo *partinfo)
 #undef TEXT_INSERT
 
 static void textview_write_body(TextView *textview, MimeInfo *mimeinfo,
-                               FILE *fp, CodeConverter *conv)
+                               FILE *fp, const gchar *charset)
 {
        FILE *tmpfp;
        gchar buf[BUFFSIZE];
+       CodeConverter *conv;
+
+       conv = conv_code_converter_new(charset);
 
        tmpfp = procmime_decode_content(NULL, fp, mimeinfo);
        if (tmpfp) {
@@ -578,6 +581,8 @@ static void textview_write_body(TextView *textview, MimeInfo *mimeinfo,
                                textview_write_line(textview, buf, conv);
                fclose(tmpfp);
        }
+
+       conv_code_converter_destroy(conv);
 }
 
 static void textview_show_html(TextView *textview, FILE *fp,