/*
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2018 the Claws Mail team and Hiroyuki Yamamoto
+ * Copyright (C) 1999-2019 the Claws Mail team and 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
for (; *p != '\0' && i < len; i++) {
PangoLogAttr *attr = attrs + i;
- gunichar wc;
+ gunichar wc = g_utf8_get_char(p);
gint uri_len;
- if (attr->is_line_break && can_break && was_white && !prev_dont_break)
+ /* attr->is_line_break will be false for some characters that
+ * we want to break a line before, like '/' or ':', so we
+ * also allow breaking on any non-wide character. The
+ * mentioned pango attribute is still useful to decide on
+ * line breaks when wide characters are involved. */
+ if ((!g_unichar_iswide(wc) || attr->is_line_break)
+ && can_break && was_white && !prev_dont_break)
pos = i;
was_white = attr->is_white;
continue;
}
- wc = g_utf8_get_char(p);
if (g_unichar_iswide(wc)) {
col += 2;
if (prev_dont_break && can_break && attr->is_line_break)
next_quote_str = compose_get_quote_str(buffer, &iter_, "e_len);
if ((quote_str || next_quote_str) &&
- strcmp2(quote_str, next_quote_str) != 0) {
+ g_strcmp0(quote_str, next_quote_str) != 0) {
g_free(next_quote_str);
return FALSE;
}
}
if (ainfo->name && mimepart->type != MIMETYPE_MESSAGE) {
if (mimepart->type == MIMETYPE_APPLICATION &&
- !strcmp2(mimepart->subtype, "octet-stream"))
+ !g_strcmp0(mimepart->subtype, "octet-stream"))
g_hash_table_insert(mimepart->typeparameters,
g_strdup("name"), g_strdup(ainfo->name));
g_hash_table_insert(mimepart->dispositionparameters,
if (mimepart->type == MIMETYPE_MESSAGE
|| mimepart->type == MIMETYPE_MULTIPART)
ainfo->encoding = ENC_BINARY;
- else if (compose->use_signing) {
+ else if (compose->use_signing || compose->fwdinfo != NULL) {
if (ainfo->encoding == ENC_7BIT)
ainfo->encoding = ENC_QUOTED_PRINTABLE;
else if (ainfo->encoding == ENC_8BIT)
g_signal_connect_after(G_OBJECT(savemsg_combo), "grab_focus",
G_CALLBACK(compose_grab_focus_cb), compose);
if (account_get_special_folder(compose->account, F_OUTBOX)) {
- if (compose->account->set_sent_folder)
+ if (compose->account->set_sent_folder || prefs_common.savemsg)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(savemsg_checkbtn), TRUE);
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(savemsg_checkbtn), FALSE);
tmp = g_strdup_printf("%s/%s", type->type, type->sub_type);
- if (g_list_find_custom(strlist, tmp, (GCompareFunc)strcmp2))
+ if (g_list_find_custom(strlist, tmp, (GCompareFunc)g_strcmp0))
g_free(tmp);
else
strlist = g_list_insert_sorted(strlist, (gpointer)tmp,
- (GCompareFunc)strcmp2);
+ (GCompareFunc)g_strcmp0);
}
for (mime_type_list = strlist; mime_type_list != NULL;
compose_set_save_to(compose, folderidentifier);
g_free(folderidentifier);
} else if (account_get_special_folder(compose->account, F_OUTBOX)) {
- if (compose->account->set_sent_folder)
+ if (compose->account->set_sent_folder || prefs_common.savemsg)
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(compose->savemsg_checkbtn), TRUE);
else
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(compose->savemsg_checkbtn), FALSE);