do not use description as attachment name
authorThorsten Maerz <torte@netztorte.de>
Sat, 22 Feb 2003 12:09:38 +0000 (12:09 +0000)
committerThorsten Maerz <torte@netztorte.de>
Sat, 22 Feb 2003 12:09:38 +0000 (12:09 +0000)
ChangeLog.claws
configure.ac
src/mimeview.c
src/prefs_common.c
src/prefs_common.h
src/procmime.c
src/procmime.h

index 22af27d..a6c3264 100644 (file)
@@ -1,3 +1,10 @@
+2003-02-22 [thorsten]  0.8.10claws43
+
+       * src/mimeview.c
+         src/prefs_common.[ch]
+         src/procmime.[ch]
+               do not use description as attachment name
+
 2003-02-22 [alfons]    0.8.10claws42
 
        * src/summaryview.c
index 449f700..e61383d 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws42
+EXTRA_VERSION=claws43
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index fd37a52..3a65ed1 100644 (file)
@@ -389,6 +389,20 @@ static gchar *get_part_name(MimeInfo *partinfo)
                return partinfo->name;
        else if (partinfo->filename)
                return partinfo->filename;
+       else if (partinfo->description)
+               return partinfo->description;
+       else
+               return "";
+}
+
+static gchar *get_part_description(MimeInfo *partinfo)
+{
+       if (partinfo->description)
+               return partinfo->description;
+       else if (partinfo->name)
+               return partinfo->name;
+       else if (partinfo->filename)
+               return partinfo->filename;
        else
                return "";
 }
@@ -404,7 +418,10 @@ static GtkCTreeNode *mimeview_append_part(MimeView *mimeview,
        str[COL_MIMETYPE] =
                partinfo->content_type ? partinfo->content_type : "";
        str[COL_SIZE] = to_human_readable(partinfo->size);
-       str[COL_NAME] = get_part_name(partinfo);
+       if (prefs_common.attach_desc)
+               str[COL_NAME] = get_part_description(partinfo);
+       else
+               str[COL_NAME] = get_part_name(partinfo);
 
        node = gtk_ctree_insert_node(ctree, parent, NULL, str, 0,
                                     NULL, NULL, NULL, NULL,
index 6e54dba..c9da35e 100644 (file)
@@ -189,6 +189,8 @@ static struct Message {
 
        GtkWidget *chkbtn_display_img;
        GtkWidget *chkbtn_resize_image;
+
+       GtkWidget *chkbtn_attach_desc;
 } message;
 
 #if USE_GPGME
@@ -692,6 +694,10 @@ static PrefParam param[] = {
        {"show_other_header", "FALSE", &prefs_common.show_other_header, P_BOOL,
         NULL, NULL, NULL},
 
+       {"attach_desc", "TRUE", &prefs_common.attach_desc, P_BOOL,
+        &message.chkbtn_attach_desc,
+        prefs_set_data_from_toggle, prefs_set_toggle},
+
        /* MIME viewer */
        {"mime_image_viewer", "display '%s'",
         &prefs_common.mime_image_viewer, P_STRING, NULL, NULL, NULL},
@@ -2334,6 +2340,8 @@ static void prefs_message_create(void)
        GtkWidget *chkbtn_display_img;
        GtkWidget *chkbtn_resize_image;
 
+       GtkWidget *chkbtn_attach_desc;
+
        vbox1 = gtk_vbox_new (FALSE, VSPACING);
        gtk_widget_show (vbox1);
        gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
@@ -2468,6 +2476,10 @@ static void prefs_message_create(void)
        PACK_CHECK_BUTTON(vbox3, chkbtn_resize_image,
                          _("Resize attached images"));
 
+       PACK_CHECK_BUTTON(vbox3, chkbtn_attach_desc,
+                         _("Show attachment descriptions (rather than names)"));
+
+
        message.chkbtn_enablecol   = chkbtn_enablecol;
        message.button_edit_col    = button_edit_col;
        message.chkbtn_mbalnum     = chkbtn_mbalnum;
@@ -2483,6 +2495,8 @@ static void prefs_message_create(void)
 
        message.chkbtn_display_img  = chkbtn_display_img;
        message.chkbtn_resize_image = chkbtn_resize_image;
+
+       message.chkbtn_attach_desc  = chkbtn_attach_desc;
 }
 
 #if USE_GPGME
index 0eadffe..0622f12 100644 (file)
@@ -218,6 +218,8 @@ struct _PrefsCommon
        gboolean show_other_header;
        GSList *disphdr_list;
 
+       gboolean attach_desc;
+
        /* MIME viewer */
        gchar *mime_image_viewer;
        gchar *mime_audio_player;
index 97585cc..e7945a7 100644 (file)
@@ -482,12 +482,10 @@ void procmime_scan_content_description(MimeInfo *mimeinfo,
        blen = strlen(buf) + 1;
        Xalloca(tmp, blen, return);
        conv_unmime_header(tmp, blen, buf, NULL);
-       g_free(mimeinfo->name);
-       mimeinfo->name = NULL;
        /*pgp signatures should NOT have a name */
        if (mimeinfo->content_type 
        &&  strcasecmp(mimeinfo->content_type, "application/pgp-signature"))
-               mimeinfo->name = g_strdup(tmp);
+               mimeinfo->description = g_strdup(tmp);
 }
 
 void procmime_scan_subject(MimeInfo *mimeinfo,
index ededf13..132885a 100644 (file)
@@ -97,6 +97,7 @@ struct _MimeInfo
 
        gchar *content_disposition;
        gchar *filename;
+       gchar *description;
 
        glong fpos;
        guint size;