sync with 0.7.8cvs3

This commit is contained in:
Paul Mangan 2002-06-19 08:04:32 +00:00
parent c333f0c843
commit d640619adf
8 changed files with 80 additions and 8 deletions

View file

@ -1,3 +1,14 @@
2002-06-19
* src/compose.c: if the Content-Type of a file is text/*, check
its content and set the optimal Content-Transfer-Encoding (thanks
to Yoichi Yuasa).
2002-06-18
* src/textview.c: textview_key_pressed(): pass key press event to
main window to activate menu shortcuts (thanks to Alfons).
2002-06-18
* src/folder.c: folder_build_tree(): use strtoul() instead of atoi()

View file

@ -1,4 +1,9 @@
2002-06-18 [paul] 0.7.8claws8
2002-06-19 [paul] 0.7.8claws9
* sync with 0.7.8claws9
see ChangeLog 2002-06-18 and 2002-06-19
2002-06-19 [paul] 0.7.8claws8
* sync with 0.7.8cvs1
see ChangeLog 2002-06-18

View file

@ -1,3 +1,15 @@
2002-06-19
* src/compose.c: ファイルの Content-Type が text/* の場合は、その
内容をチェックして最適な Content-Transfer-Encoding を指定
(湯浅さん thanks)。
2002-06-18
* src/textview.c: textview_key_pressed(): メニューショートカットを
作動させるためにキープレスイベントをメインウィンドウに渡すように
した(Alfons さん thanks)。
2002-06-18
* src/folder.c: folder_build_tree(): 繰り下げを防ぐために mtime に

View file

@ -8,7 +8,7 @@ MINOR_VERSION=7
MICRO_VERSION=8
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_VERSION=claws8
EXTRA_VERSION=claws9
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl set $target

View file

@ -1966,16 +1966,24 @@ static void compose_attach_append(Compose *compose, const gchar *file,
(_("Message: %s"),
g_basename(filename ? filename : file));
} else {
ainfo->encoding = ENC_BASE64;
if (!g_strncasecmp(content_type, "text", 4))
ainfo->encoding =
procmime_get_encoding_for_file(file);
else
ainfo->encoding = ENC_BASE64;
ainfo->name = g_strdup
(g_basename(filename ? filename : file));
}
} else {
ainfo->content_type = procmime_get_mime_type(file);
if (!ainfo->content_type)
if (!ainfo->content_type) {
ainfo->content_type =
g_strdup("application/octet-stream");
ainfo->encoding = ENC_BASE64;
ainfo->encoding = ENC_BASE64;
} else if (!g_strncasecmp(ainfo->content_type, "text", 4))
ainfo->encoding = procmime_get_encoding_for_file(file);
else
ainfo->encoding = ENC_BASE64;
ainfo->name = g_strdup(g_basename(filename ? filename : file));
}
ainfo->size = size;

View file

@ -1262,6 +1262,33 @@ EncodingType procmime_get_encoding_for_charset(const gchar *charset)
/* return ENC_QUOTED_PRINTABLE; */
}
EncodingType procmime_get_encoding_for_file(const gchar *file)
{
FILE *fp;
guchar buf[BUFSIZ];
size_t len;
if ((fp = fopen(file, "rb")) == NULL) {
FILE_OP_ERROR(file, "fopen");
return ENC_UNKNOWN;
}
while ((len = fread(buf, sizeof(gchar), sizeof(buf), fp)) > 0) {
guchar *p;
gint i;
for (p = buf, i = 0; i < len; p++, i++) {
if (*p & 0x80) {
fclose(fp);
return ENC_BASE64;
}
}
}
fclose(fp);
return ENC_7BIT;
}
const gchar *procmime_get_encoding_str(EncodingType encoding)
{
static const gchar *encoding_str[] = {

View file

@ -177,6 +177,7 @@ gchar *procmime_get_mime_type (const gchar *filename);
GList *procmime_get_mime_type_list (void);
EncodingType procmime_get_encoding_for_charset (const gchar *charset);
EncodingType procmime_get_encoding_for_file (const gchar *file);
const gchar *procmime_get_encoding_str (EncodingType encoding);
void renderer_read_config(void);

View file

@ -1660,7 +1660,8 @@ static gint textview_key_pressed(GtkWidget *widget, GdkEventKey *event,
case GDK_y:
case GDK_t:
case GDK_l:
if (messageview->type == MVIEW_MIME) {
if (messageview->type == MVIEW_MIME &&
textview == messageview->mimeview->textview) {
KEY_PRESS_EVENT_STOP();
mimeview_pass_key_press_event(messageview->mimeview,
event);
@ -1668,8 +1669,15 @@ static gint textview_key_pressed(GtkWidget *widget, GdkEventKey *event,
}
/* fall through */
default:
if (summaryview)
summary_pass_key_press_event(summaryview, event);
if (summaryview &&
event->window != messageview->mainwin->window->window) {
GdkEventKey tmpev = *event;
tmpev.window = messageview->mainwin->window->window;
KEY_PRESS_EVENT_STOP();
gtk_widget_event(messageview->mainwin->window,
(GdkEvent *)&tmpev);
}
break;
}