Switch core from strerror to g_strerror
[claws.git] / src / mimeview.c
index 8b20d5cd000b60d45ca2e86e08abba4dc0db0096..4ee68bb3bd75ee0a827dc144ca8061fdadd7299f 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * 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
@@ -14,7 +14,7 @@
  *
  * 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
@@ -458,9 +458,6 @@ MimeView *mimeview_create(MainWindow *mainwin)
        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;
@@ -1462,7 +1459,8 @@ static void mimeview_selected(GtkTreeSelection *selection, MimeView *mimeview)
                }
        }
 
-       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);
        }
 }
@@ -1710,8 +1708,9 @@ static void mimeview_drag_data_get(GtkWidget          *widget,
                                }
                                procheader_header_array_destroy(headers);
                        }
-                       fclose(fp);
                }
+               if (fp != NULL)
+                       fclose(fp);
                if (name)
                        filename = g_path_get_basename(name);
                g_free(name);
@@ -1762,7 +1761,7 @@ check_new_file:
        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);
@@ -1851,7 +1850,7 @@ static gboolean mimeview_write_part(const gchar *filename,
        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;
        }
 
@@ -2043,7 +2042,7 @@ void mimeview_launch(MimeView *mimeview, MimeInfo *partinfo)
        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);
 
@@ -2079,7 +2078,7 @@ static void mimeview_open_part_with(MimeView *mimeview, MimeInfo *partinfo, gboo
        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;
        }
@@ -2191,7 +2190,7 @@ static void mimeview_send_to(MimeView *mimeview, MimeInfo *partinfo)
        } else
                alertpanel_error
                        (_("Couldn't save the part of multipart message: %s"), 
-                               strerror(-err));
+                               g_strerror(-err));
        g_free(filename);
 }
 
@@ -2412,9 +2411,6 @@ static void icon_list_append_icon (MimeView *mimeview, MimeInfo *mimeinfo)
 #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;