2008-09-20 [colin] 3.5.0cvs118
[claws.git] / src / compose.c
index e1e6039939426e8e00257571c2c5cd60e71a378a..b55d6374d28b134d834b73a252e2374414fb30e9 100644 (file)
@@ -238,7 +238,6 @@ static void compose_reedit_set_entry                (Compose        *compose,
 
 static void compose_insert_sig                 (Compose        *compose,
                                                 gboolean        replace);
-static gchar *compose_get_signature_str                (Compose        *compose);
 static ComposeInsertResult compose_insert_file (Compose        *compose,
                                                 const gchar    *file);
 
@@ -3240,58 +3239,6 @@ static void compose_insert_sig(Compose *compose, gboolean replace)
        UNBLOCK_WRAP();
 }
 
-static gchar *compose_get_signature_str(Compose *compose)
-{
-       gchar *sig_body = NULL;
-       gchar *sig_str = NULL;
-       gchar *utf8_sig_str = NULL;
-
-       g_return_val_if_fail(compose->account != NULL, NULL);
-
-       if (!compose->account->sig_path)
-               return NULL;
-
-       if (compose->account->sig_type == SIG_FILE) {
-               if (!is_file_or_fifo_exist(compose->account->sig_path)) {
-                       g_warning("can't open signature file: %s\n",
-                                 compose->account->sig_path);
-                       return NULL;
-               }
-       }
-
-       if (compose->account->sig_type == SIG_COMMAND)
-               sig_body = get_command_output(compose->account->sig_path);
-       else {
-               gchar *tmp;
-
-               tmp = file_read_to_str(compose->account->sig_path);
-               if (!tmp)
-                       return NULL;
-               sig_body = normalize_newlines(tmp);
-               g_free(tmp);
-       }
-
-       if (compose->account->sig_sep) {
-               sig_str = g_strconcat("\n", compose->account->sig_sep, "\n", sig_body,
-                                     NULL);
-               g_free(sig_body);
-       } else
-               sig_str = g_strconcat("\n", sig_body, NULL);
-
-       if (sig_str) {
-               if (g_utf8_validate(sig_str, -1, NULL) == TRUE)
-                       utf8_sig_str = sig_str;
-               else {
-                       utf8_sig_str = conv_codeset_strdup
-                               (sig_str, conv_get_locale_charset_str_no_utf8(),
-                                CS_INTERNAL);
-                       g_free(sig_str);
-               }
-       }
-
-       return utf8_sig_str;
-}
-
 static ComposeInsertResult compose_insert_file(Compose *compose, const gchar *file)
 {
        GtkTextView *text;
@@ -8455,7 +8402,11 @@ static void compose_exec_ext_editor(Compose *compose)
 
                compose_set_ext_editor_sensitive(compose, FALSE);
 
+#ifndef G_OS_WIN32
                compose->exteditor_ch = g_io_channel_unix_new(pipe_fds[0]);
+#else
+               compose->exteditor_ch = g_io_channel_win32_new_fd(pipe_fds[0]);
+#endif
                compose->exteditor_tag = g_io_add_watch(compose->exteditor_ch,
                                                        G_IO_IN,
                                                        compose_input_cb,
@@ -8903,7 +8854,7 @@ static void compose_register_draft(MsgInfo *info)
 {
        gchar *filepath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                                      DRAFTED_AT_EXIT, NULL);
-       FILE *fp = fopen(filepath, "ab");
+       FILE *fp = g_fopen(filepath, "ab");
        
        if (fp) {
                fprintf(fp, "%s\t%d\n", folder_item_get_identifier(info->folder), 
@@ -9150,7 +9101,7 @@ void compose_reopen_exit_drafts(void)
 {
        gchar *filepath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S,
                                      DRAFTED_AT_EXIT, NULL);
-       FILE *fp = fopen(filepath, "rb");
+       FILE *fp = g_fopen(filepath, "rb");
        gchar buf[1024];
        
        if (fp) {