/*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2013 Hiroyuki Yamamoto and the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2015 Hiroyuki Yamamoto and the Claws Mail team
*
* 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
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ *
*/
#ifdef HAVE_CONFIG_H
mimeview->icon_mainbox = icon_mainbox;
mimeview->icon_count = 0;
mimeview->mainwin = mainwin;
-#if !(GTK_CHECK_VERSION(2,12,0))
- mimeview->tooltips = tips;
-#endif
mimeview->mime_toggle = mime_toggle;
mimeview->siginfoview = siginfoview;
mimeview->scrollbutton = scrollbutton;
}
}
- if (mimeview->siginfo && privacy_auto_check_signatures(mimeview->siginfo)) {
+ if (mimeview->siginfo && privacy_auto_check_signatures(mimeview->siginfo)
+ && privacy_mimeinfo_get_sig_status(mimeview->siginfo) == SIGNATURE_UNCHECKED) {
mimeview_check_signature(mimeview);
}
}
FILE *fp;
fp = g_fopen(partinfo->data.filename, "rb");
- fseek(fp, partinfo->offset, SEEK_SET);
- headers = procheader_get_header_array_asis(fp);
- if (headers) {
- gint i;
- for (i = 0; i < headers->len; i++) {
- Header *header = g_ptr_array_index(headers, i);
- if (procheader_headername_equal(header->name, "Subject")) {
- unfold_line(header->body);
- name = g_strconcat(header->body, ".txt", NULL);
- subst_for_filename(name);
+ if (fp != NULL && fseek(fp, partinfo->offset, SEEK_SET) == 0) {
+ headers = procheader_get_header_array_asis(fp);
+ if (headers) {
+ gint i;
+ for (i = 0; i < headers->len; i++) {
+ Header *header = g_ptr_array_index(headers, i);
+ if (procheader_headername_equal(header->name, "Subject")) {
+ unfold_line(header->body);
+ name = g_strconcat(header->body, ".txt", NULL);
+ subst_for_filename(name);
+ }
}
+ procheader_header_array_destroy(headers);
}
- procheader_header_array_destroy(headers);
}
- fclose(fp);
+ if (fp != NULL)
+ fclose(fp);
if (name)
filename = g_path_get_basename(name);
g_free(name);
if ((err = procmime_get_part(filename, partinfo)) < 0)
alertpanel_error
(_("Couldn't save the part of multipart message: %s"),
- strerror(-err));
+ g_strerror(-err));
tmp = g_filename_to_uri(filename, NULL, NULL);
uriname = g_strconcat(tmp, "\r\n", NULL);
if ((err = procmime_get_part(filename, partinfo)) < 0) {
alertpanel_error
(_("Couldn't save the part of multipart message: %s"),
- strerror(-err));
+ g_strerror(-err));
return FALSE;
}
if ((err = procmime_get_part(filename, partinfo)) < 0)
alertpanel_error
(_("Couldn't save the part of multipart message: %s"),
- strerror(-err));
+ g_strerror(-err));
else
mimeview_view_file(filename, partinfo, NULL, mimeview);
if ((err = procmime_get_part(filename, partinfo)) < 0) {
alertpanel_error
(_("Couldn't save the part of multipart message: %s"),
- strerror(-err));
+ g_strerror(-err));
g_free(filename);
return;
}
} else
alertpanel_error
(_("Couldn't save the part of multipart message: %s"),
- strerror(-err));
+ g_strerror(-err));
g_free(filename);
}
#ifdef GENERIC_UMPC
GtkRequisition r;
#endif
-#if !(GTK_CHECK_VERSION(2,12,0))
- GtkTooltips *tips = mimeview->tooltips;
-#endif
if (!prefs_common.show_inline_attachments && mimeinfo->id)
return;
children = gtk_container_get_children(GTK_CONTAINER(mimeview->icon_vbox));
for (child = children; child != NULL; child = g_list_next(child)) {
+ gboolean *highlight = NULL;
+ GtkWidget *icon = gtk_bin_get_child(GTK_BIN(child->data));
+
if (!GTK_IS_EVENT_BOX(child->data))
continue;
- if(g_object_get_data(G_OBJECT(child->data),
- "partinfo") == (gpointer)mimeinfo) {
- gboolean *highlight = NULL;
- GtkWidget *icon = gtk_bin_get_child(GTK_BIN(child->data));
- highlight = g_object_get_data(G_OBJECT(icon), "highlight");
- *highlight = TRUE;
- gtk_widget_queue_draw(icon);
- } else {
- gint *highlight = NULL;
- GtkWidget *icon = gtk_bin_get_child(GTK_BIN(child->data));
- highlight = g_object_get_data(G_OBJECT(icon), "highlight");
- *highlight = FALSE;
- gtk_widget_queue_draw(icon);
- }
+
+ highlight = g_object_get_data(G_OBJECT(icon), "highlight");
+ *highlight = (g_object_get_data(G_OBJECT(child->data),
+ "partinfo") == (gpointer)mimeinfo);
+
+ gtk_widget_queue_draw(icon);
}
g_list_free(children);
}
return TRUE;
}
-void mimeview_update (MimeView *mimeview) {
+void mimeview_update (MimeView *mimeview)
+{
if (mimeview && mimeview->mimeinfo) {
icon_list_clear(mimeview);
icon_list_create(mimeview, mimeview->mimeinfo);