2005-12-14 [colin] 1.9.100cvs89
authorColin Leroy <colin@colino.net>
Wed, 14 Dec 2005 17:58:42 +0000 (17:58 +0000)
committerColin Leroy <colin@colino.net>
Wed, 14 Dec 2005 17:58:42 +0000 (17:58 +0000)
* src/compose.c
* src/imap.c
* src/summaryview.c
* src/gtk/gtkaspell.c
More leaks fixed
* src/prefs_folder_item.c
Fix recursive prefs apply

ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/gtk/gtkaspell.c
src/imap.c
src/prefs_folder_item.c
src/summaryview.c

index edbad3f..23b963e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2005-12-14 [colin]     1.9.100cvs89
+
+       * src/compose.c
+       * src/imap.c
+       * src/summaryview.c
+       * src/gtk/gtkaspell.c
+               More leaks fixed
+       * src/prefs_folder_item.c
+               Fix recursive prefs apply
+
+
 2005-12-14 [cleroy]    1.9.100cvs88
 
        * src/compose.c
index 758849f..3e65b00 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.179.2.83 -r 1.179.2.84 src/imap.c;  cvs diff -u -r 1.101.2.18 -r 1.101.2.19 src/news.c;  cvs diff -u -r 1.13.2.10 -r 1.13.2.11 src/common/plugin.c;  cvs diff -u -r 1.1.4.25 -r 1.1.4.26 src/etpan/imap-thread.c;  ) > 1.9.100cvs86.patchset
 ( cvs diff -u -r 1.382.2.203 -r 1.382.2.204 src/compose.c;  ) > 1.9.100cvs87.patchset
 ( cvs diff -u -r 1.382.2.204 -r 1.382.2.205 src/compose.c;  ) > 1.9.100cvs88.patchset
+( cvs diff -u -r 1.382.2.205 -r 1.382.2.206 src/compose.c;  cvs diff -u -r 1.179.2.84 -r 1.179.2.85 src/imap.c;  cvs diff -u -r 1.52.2.16 -r 1.52.2.17 src/prefs_folder_item.c;  cvs diff -u -r 1.395.2.151 -r 1.395.2.152 src/summaryview.c;  cvs diff -u -r 1.9.2.33 -r 1.9.2.34 src/gtk/gtkaspell.c;  ) > 1.9.100cvs89.patchset
index 506eb7e..2743d20 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=100
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=88
+EXTRA_VERSION=89
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 9d8d960..1fb7e1c 100644 (file)
@@ -3362,6 +3362,10 @@ static void compose_beautify_paragraph(Compose *compose, GtkTextIter *par_iter,
 
                        /* move iter to current line start */
                        gtk_text_iter_set_line_offset(&iter, 0);
+                       if (quote_str) {
+                               g_free(quote_str);
+                               quote_str = NULL;
+                       }
                        continue;
                } else {
                        /* move iter to next line start */
@@ -3997,6 +4001,7 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action)
         mimemsg->type = MIMETYPE_MESSAGE;
         mimemsg->subtype = g_strdup("rfc822");
        mimemsg->content = MIMECONTENT_MEM;
+       mimemsg->tmp = TRUE; /* must free content later */
        mimemsg->data.mem = compose_get_header(compose);
 
        /* Create text part MimeInfo */
@@ -4101,6 +4106,7 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action)
 
        mimetext = procmime_mimeinfo_new();
        mimetext->content = MIMECONTENT_MEM;
+       mimetext->tmp = TRUE; /* must free content later */
        mimetext->data.mem = buf;
        mimetext->type = MIMETYPE_TEXT;
        mimetext->subtype = g_strdup("plain");
@@ -4504,6 +4510,7 @@ static void compose_add_attachments(Compose *compose, MimeInfo *parent)
                mimepart = procmime_mimeinfo_new();
                mimepart->content = MIMECONTENT_FILE;
                mimepart->data.filename = g_strdup(ainfo->file);
+               mimepart->tmp = FALSE; /* or we destroy our attachment */
                mimepart->offset = 0;
 
                stat(ainfo->file, &statbuf);
index 7c04466..68d9471 100644 (file)
@@ -916,7 +916,7 @@ static guchar get_text_index_whar(GtkAspell *gtkaspell, int pos)
        GtkTextView *view = gtkaspell->gtktext;
        GtkTextBuffer *buffer = gtk_text_view_get_buffer(view);
        GtkTextIter start, end;
-       const gchar *utf8chars;
+       gchar *utf8chars;
        guchar a = '\0';
 
        gtk_text_buffer_get_iter_at_offset(buffer, &start, pos);
@@ -933,6 +933,7 @@ static guchar get_text_index_whar(GtkAspell *gtkaspell, int pos)
                        g_free(tr);
                }
        }
+       g_free(utf8chars);
 
        return a;
 }
index 48ddf08..2fa20c8 100644 (file)
@@ -1103,6 +1103,8 @@ static gint imap_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list,
                        last_uid = new_uid;
                if (file_is_tmp)
                        g_unlink(real_file);
+
+               g_free(real_file);
        }
        statusbar_progress_all(0,0,0);
        statusbar_pop_all();
index e5a201d..d5ff62b 100644 (file)
@@ -778,6 +778,10 @@ static gboolean compose_save_recurse_func(GNode *node, gpointer data)
            !(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->request_return_receipt_rec_checkbtn)) ||
              gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->save_copy_to_folder_rec_checkbtn)) ||
              gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_to_rec_checkbtn)) ||
+             gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_account_rec_checkbtn)) ||
+#if USE_ASPELL
+             gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_dictionary_rec_checkbtn)) ||
+#endif
              gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_reply_to_rec_checkbtn))))
                return TRUE;
 
index c8690e2..0e786e8 100644 (file)
@@ -176,7 +176,8 @@ static void summary_set_ctree_from_list     (SummaryView            *summaryview,
                                         GSList                 *mlist);
 static void summary_set_header         (SummaryView            *summaryview,
                                         gchar                  *text[],
-                                        MsgInfo                *msginfo);
+                                        MsgInfo                *msginfo,
+                                        gboolean               *free_from_to);
 static void summary_display_msg                (SummaryView            *summaryview,
                                         GtkCTreeNode           *row);
 static void summary_display_msg_full   (SummaryView            *summaryview,
@@ -2226,8 +2227,9 @@ gboolean summary_insert_gnode_func(GtkCTree *ctree, guint depth, GNode *gnode,
        gint *col_pos = summaryview->col_pos;
        const gchar *msgid = msginfo->msgid;
        GHashTable *msgid_table = summaryview->msgid_table;
-
-       summary_set_header(summaryview, text, msginfo);
+       gboolean free_from_to = FALSE;
+       
+       summary_set_header(summaryview, text, msginfo, &free_from_to);
 
        gtk_sctree_set_node_info(ctree, cnode, text[col_pos[S_COL_SUBJECT]], 2,
                                NULL, NULL, NULL, NULL, FALSE,
@@ -2244,6 +2246,13 @@ gboolean summary_insert_gnode_func(GtkCTree *ctree, guint depth, GNode *gnode,
        SET_TEXT(S_COL_TO);
        /* SET_TEXT(S_COL_SUBJECT);  already set by node info */
 
+       if (free_from_to) {
+               g_free(text[col_pos[S_COL_FROM]]);
+               g_free(text[col_pos[S_COL_TO]]);
+               text[col_pos[S_COL_FROM]] = NULL;
+               text[col_pos[S_COL_TO]] = NULL;
+       }
+
 #undef SET_TEXT
 
        GTKUT_CTREE_NODE_SET_ROW_DATA(cnode, msginfo);
@@ -2301,16 +2310,25 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
                summary_thread_init(summaryview);
        } else {
                gchar *text[N_SUMMARY_COLS];
+               gboolean free_from_to = FALSE;
+               gint *col_pos = summaryview->col_pos;
+
                cur = mlist;
                for (; mlist != NULL; mlist = mlist->next) {
                        msginfo = (MsgInfo *)mlist->data;
 
-                       summary_set_header(summaryview, text, msginfo);
+                       summary_set_header(summaryview, text, msginfo, &free_from_to);
 
                        node = gtk_sctree_insert_node
                                (ctree, NULL, node, text, 2,
                                 NULL, NULL, NULL, NULL,
                                 FALSE, FALSE);
+                       if (free_from_to) {
+                               g_free(text[col_pos[S_COL_FROM]]);
+                               g_free(text[col_pos[S_COL_TO]]);
+                               text[col_pos[S_COL_FROM]] = NULL;
+                               text[col_pos[S_COL_TO]] = NULL;
+                       }
                        GTKUT_CTREE_NODE_SET_ROW_DATA(node, msginfo);
                        summary_set_marks_func(ctree, node, summaryview);
 
@@ -2392,7 +2410,7 @@ static gchar *summary_complete_address(const gchar *addr)
 }
 
 static void summary_set_header(SummaryView *summaryview, gchar *text[],
-                              MsgInfo *msginfo)
+                              MsgInfo *msginfo, gboolean *free_from_to)
 {
        static gchar date_modified[80];
        static gchar col_score[11];
@@ -2457,12 +2475,14 @@ static void summary_set_header(SummaryView *summaryview, gchar *text[],
        if (!should_swap) {
                text[col_pos[S_COL_FROM]] = from_text;
                text[col_pos[S_COL_TO]] = to_text;
+               free_from_to = FALSE;
        } else {
                gchar *tmp = NULL;
                tmp = g_strconcat("-->", to_text, NULL);
                text[col_pos[S_COL_FROM]] = tmp;
                tmp = g_strconcat("<--", from_text, NULL);
                text[col_pos[S_COL_TO]] = tmp;
+               free_from_to = TRUE;
        }
        
        if (summaryview->simplify_subject_preg != NULL)