2005-10-18 [colin] 1.9.15cvs72
authorColin Leroy <colin@colino.net>
Tue, 18 Oct 2005 17:15:44 +0000 (17:15 +0000)
committerColin Leroy <colin@colino.net>
Tue, 18 Oct 2005 17:15:44 +0000 (17:15 +0000)
* src/Makefile.am
* src/addressadd.c
* src/addressbook.c
* src/folderview.c
* src/grouplistdialog.c
* src/mimeview.c
* src/stock_pixmap.c
* src/stock_pixmap.h
* src/summaryview.c
* src/gtk/gtksctree.c
* src/gtk/gtksctree.h
* src/pixmaps/empty.xpm
Implement a wrapper call for gtk_ctree_set_node_info
and gtk_ctree_insert_node, that uses a 1x1 transparent
pixmap instead of a NULL one. This works around some
memory problems deep inside gtk, revealed by valgrind,
and fixes bug #834 (Pressing CTRl-D on a message marked
as locked crashes sylpheed.), as well as, probably,
wwp's 4th dimension problems that happen in gtk_ctree_*.

15 files changed:
ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/Makefile.am
src/addressadd.c
src/addressbook.c
src/folderview.c
src/grouplistdialog.c
src/gtk/gtksctree.c
src/gtk/gtksctree.h
src/mimeview.c
src/pixmaps/empty.xpm [new file with mode: 0644]
src/stock_pixmap.c
src/stock_pixmap.h
src/summaryview.c

index c883fa666f785de80be73b54fbce99e155fcbb02..6f2df3ceed8eeb84cfe61b80809adb1af3f14600 100644 (file)
@@ -1,3 +1,25 @@
+2005-10-18 [colin]     1.9.15cvs72
+
+       * src/Makefile.am
+       * src/addressadd.c
+       * src/addressbook.c
+       * src/folderview.c
+       * src/grouplistdialog.c
+       * src/mimeview.c
+       * src/stock_pixmap.c
+       * src/stock_pixmap.h
+       * src/summaryview.c
+       * src/gtk/gtksctree.c
+       * src/gtk/gtksctree.h
+       * src/pixmaps/empty.xpm
+               Implement a wrapper call for gtk_ctree_set_node_info
+               and gtk_ctree_insert_node, that uses a 1x1 transparent
+               pixmap instead of a NULL one. This works around some
+               memory problems deep inside gtk, revealed by valgrind,
+               and fixes bug #834 (Pressing CTRl-D on a message marked 
+               as locked crashes sylpheed.), as well as, probably, 
+               wwp's 4th dimension problems that happen in gtk_ctree_*.
+
 2005-10-17 [colin]     1.9.15cvs71
 
        * src/mimeview.c
 2005-10-17 [colin]     1.9.15cvs71
 
        * src/mimeview.c
index 5de97d6a5afd6f85da8853f4aac5cbb9061e5f2c..927750cab8de9f4452604910c430c6356acb4824 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.27.2.14 -r 1.27.2.15 src/addr_compl.c;  cvs diff -u -r 1.179.2.79 -r 1.179.2.80 src/imap.c;  ) > 1.9.15cvs69.patchset
 ( cvs diff -u -r 1.115.2.59 -r 1.115.2.60 src/main.c;  ) > 1.9.15cvs70.patchset
 ( cvs diff -u -r 1.83.2.46 -r 1.83.2.47 src/mimeview.c;  ) > 1.9.15cvs71.patchset
 ( cvs diff -u -r 1.27.2.14 -r 1.27.2.15 src/addr_compl.c;  cvs diff -u -r 1.179.2.79 -r 1.179.2.80 src/imap.c;  ) > 1.9.15cvs69.patchset
 ( cvs diff -u -r 1.115.2.59 -r 1.115.2.60 src/main.c;  ) > 1.9.15cvs70.patchset
 ( cvs diff -u -r 1.83.2.46 -r 1.83.2.47 src/mimeview.c;  ) > 1.9.15cvs71.patchset
+( cvs diff -u -r 1.155.2.32 -r 1.155.2.33 src/Makefile.am;  cvs diff -u -r 1.9.2.5 -r 1.9.2.6 src/addressadd.c;  cvs diff -u -r 1.60.2.37 -r 1.60.2.38 src/addressbook.c;  cvs diff -u -r 1.207.2.73 -r 1.207.2.74 src/folderview.c;  cvs diff -u -r 1.14.2.11 -r 1.14.2.12 src/grouplistdialog.c;  cvs diff -u -r 1.83.2.47 -r 1.83.2.48 src/mimeview.c;  cvs diff -u -r 1.25.2.18 -r 1.25.2.19 src/stock_pixmap.c;  cvs diff -u -r 1.18.2.12 -r 1.18.2.13 src/stock_pixmap.h;  cvs diff -u -r 1.395.2.140 -r 1.395.2.141 src/summaryview.c;  cvs diff -u -r 1.1.4.9 -r 1.1.4.10 src/gtk/gtksctree.c;  cvs diff -u -r 1.1.4.3 -r 1.1.4.4 src/gtk/gtksctree.h;  diff -u /dev/null src/pixmaps/empty.xpm;  ) > 1.9.15cvs72.patchset
index dadf1e8efb959475786a558131907021d70ab0c6..d8dcacce39be0c253b212aba90e14dfb7f58403b 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=15
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=15
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=71
+EXTRA_VERSION=72
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index b03e53c6ff3241b3bebf482c244c642bd4ee5871..d668fbdb06181d7d32421bfcde7a304ca8df9554 100644 (file)
@@ -382,7 +382,8 @@ EXTRA_DIST = \
        pixmaps/outbox_hrm_mark.xpm \
        pixmaps/outbox_mark.xpm \
        pixmaps/trash_hrm_mark.xpm \
        pixmaps/outbox_hrm_mark.xpm \
        pixmaps/outbox_mark.xpm \
        pixmaps/trash_hrm_mark.xpm \
-       pixmaps/trash_mark.xpm
+       pixmaps/trash_mark.xpm \
+       pixmaps/empty.xpm
 
 
 INCLUDES = \
 
 
 INCLUDES = \
index d298c6e4c5fc39bc9f2d734c58f018b731abb913..f74f6b3a7d2ed2a64538e521c230a331c9227bda 100644 (file)
@@ -291,7 +291,7 @@ static void addressadd_load_folder( GtkCTreeNode *parentNode, ItemFolder *parent
                folder = list->data;
                fName = g_strdup( ADDRITEM_NAME(folder) );
                name = &fName;
                folder = list->data;
                fName = g_strdup( ADDRITEM_NAME(folder) );
                name = &fName;
-               node = gtk_ctree_insert_node( tree, parentNode, NULL, name, FOLDER_SPACING,
+               node = gtk_sctree_insert_node( tree, parentNode, NULL, name, FOLDER_SPACING,
                                folderXpm, folderXpmMask, folderXpm, folderXpmMask,
                                FALSE, TRUE );
                g_free( fName );
                                folderXpm, folderXpmMask, folderXpm, folderXpmMask,
                                FALSE, TRUE );
                g_free( fName );
@@ -332,7 +332,7 @@ static void addressadd_load_data( AddressIndex *addrIndex ) {
                                /* Add node for address book */
                                abf = ds->rawDataSource;
                                name = &dsName;
                                /* Add node for address book */
                                abf = ds->rawDataSource;
                                name = &dsName;
-                               node = gtk_ctree_insert_node( tree, NULL, NULL,
+                               node = gtk_sctree_insert_node( tree, NULL, NULL,
                                                name, FOLDER_SPACING, bookXpm,
                                                bookXpmMask, bookXpm, bookXpmMask,
                                                FALSE, TRUE );
                                                name, FOLDER_SPACING, bookXpm,
                                                bookXpmMask, bookXpm, bookXpmMask,
                                                FALSE, TRUE );
index b3e48177ec2b5db979afb9ef9dff1c7b506dc727..2140a570078f73253f6415f807ea5e9f81add1e1 100644 (file)
@@ -968,7 +968,7 @@ static void addressbook_create(void)
                        AddressTypeControlItem *atci = adapter->atci;
                        text = atci->displayName;
                        adapter->treeNode =
                        AddressTypeControlItem *atci = adapter->atci;
                        text = atci->displayName;
                        adapter->treeNode =
-                               gtk_ctree_insert_node( GTK_CTREE(ctree),
+                               gtk_sctree_insert_node( GTK_CTREE(ctree),
                                        NULL, NULL, &text, FOLDER_SPACING,
                                        interfacexpm, interfacexpmmask,
                                        interfacexpm, interfacexpmmask,
                                        NULL, NULL, &text, FOLDER_SPACING,
                                        interfacexpm, interfacexpmmask,
                                        interfacexpm, interfacexpmmask,
@@ -2304,7 +2304,7 @@ static void addressbook_change_node_name(GtkCTreeNode *node, const gchar *name)
        gtk_ctree_get_node_info(ctree, node, text, &spacing,
                                &pix_cl, &mask_cl, &pix_op, &mask_op,
                                &is_leaf, &expanded);
        gtk_ctree_get_node_info(ctree, node, text, &spacing,
                                &pix_cl, &mask_cl, &pix_op, &mask_op,
                                &is_leaf, &expanded);
-       gtk_ctree_set_node_info(ctree, node, name, spacing,
+       gtk_sctree_set_node_info(ctree, node, name, spacing,
                                pix_cl, mask_cl, pix_op, mask_op,
                                is_leaf, expanded);
 }
                                pix_cl, mask_cl, pix_op, mask_op,
                                is_leaf, expanded);
 }
@@ -2840,7 +2840,7 @@ static void addressbook_load_group( GtkCTree *clist, ItemGroup *itemGroup ) {
                }
                text[COL_ADDRESS] = email->address;
                text[COL_REMARKS] = email->remarks;
                }
                text[COL_ADDRESS] = email->address;
                text[COL_REMARKS] = email->remarks;
-               nodeEMail = gtk_ctree_insert_node(
+               nodeEMail = gtk_sctree_insert_node(
                                clist, NULL, NULL,
                                text, FOLDER_SPACING,
                                atci->iconXpm, atci->maskXpm,
                                clist, NULL, NULL,
                                text, FOLDER_SPACING,
                                atci->iconXpm, atci->maskXpm,
@@ -2885,7 +2885,7 @@ static void addressbook_folder_load_one_person(
                        else {
                                text[COL_NAME] = ADDRITEM_NAME(person);
                        }
                        else {
                                text[COL_NAME] = ADDRITEM_NAME(person);
                        }
-                       nodePerson = gtk_ctree_insert_node(
+                       nodePerson = gtk_sctree_insert_node(
                                        clist, NULL, NULL,
                                        text, FOLDER_SPACING,
                                        atci->iconXpm, atci->maskXpm,
                                        clist, NULL, NULL,
                                        text, FOLDER_SPACING,
                                        atci->iconXpm, atci->maskXpm,
@@ -2898,7 +2898,7 @@ static void addressbook_folder_load_one_person(
                else {
                        /* Subsequent email is a child node of person */
                        text[COL_NAME] = ADDRITEM_NAME(email);
                else {
                        /* Subsequent email is a child node of person */
                        text[COL_NAME] = ADDRITEM_NAME(email);
-                       nodeEMail = gtk_ctree_insert_node(
+                       nodeEMail = gtk_sctree_insert_node(
                                        clist, nodePerson, NULL,
                                        text, FOLDER_SPACING,
                                        atciMail->iconXpm, atciMail->maskXpm,
                                        clist, nodePerson, NULL,
                                        text, FOLDER_SPACING,
                                        atciMail->iconXpm, atciMail->maskXpm,
@@ -2914,7 +2914,7 @@ static void addressbook_folder_load_one_person(
                text[COL_NAME] = ADDRITEM_NAME(person);
                text[COL_ADDRESS] = NULL;
                text[COL_REMARKS] = NULL;
                text[COL_NAME] = ADDRITEM_NAME(person);
                text[COL_ADDRESS] = NULL;
                text[COL_REMARKS] = NULL;
-               nodePerson = gtk_ctree_insert_node(
+               nodePerson = gtk_sctree_insert_node(
                                clist, NULL, NULL,
                                text, FOLDER_SPACING,
                                atci->iconXpm, atci->maskXpm,
                                clist, NULL, NULL,
                                text, FOLDER_SPACING,
                                atci->iconXpm, atci->maskXpm,
@@ -3002,7 +3002,7 @@ static void addressbook_folder_load_group( GtkCTree *clist, ItemFolder *itemFold
                text[COL_NAME] = ADDRITEM_NAME(group);
                text[COL_ADDRESS] = NULL;
                text[COL_REMARKS] = NULL;
                text[COL_NAME] = ADDRITEM_NAME(group);
                text[COL_ADDRESS] = NULL;
                text[COL_REMARKS] = NULL;
-               nodeGroup = gtk_ctree_insert_node(clist, NULL, NULL,
+               nodeGroup = gtk_sctree_insert_node(clist, NULL, NULL,
                                      text, FOLDER_SPACING,
                                      atci->iconXpm, atci->maskXpm,
                                      atci->iconXpmOpen, atci->maskXpmOpen,
                                      text, FOLDER_SPACING,
                                      atci->iconXpm, atci->maskXpm,
                                      atci->iconXpmOpen, atci->maskXpmOpen,
@@ -3444,7 +3444,7 @@ static GtkCTreeNode *addressbook_add_object(GtkCTreeNode *node,
                        /* Add object to tree */
                        gchar **name;
                        name = &obj->name;
                        /* Add object to tree */
                        gchar **name;
                        name = &obj->name;
-                       added = gtk_ctree_insert_node( ctree, node, NULL, name, FOLDER_SPACING,
+                       added = gtk_sctree_insert_node( ctree, node, NULL, name, FOLDER_SPACING,
                                atci->iconXpm, atci->maskXpm, atci->iconXpmOpen, atci->maskXpmOpen,
                                atci->treeLeaf, atci->treeExpand );
                        gtk_ctree_node_set_row_data_full( ctree, added, obj,
                                atci->iconXpm, atci->maskXpm, atci->iconXpmOpen, atci->maskXpmOpen,
                                atci->treeLeaf, atci->treeExpand );
                        gtk_ctree_node_set_row_data_full( ctree, added, obj,
@@ -3486,7 +3486,7 @@ static GtkCTreeNode *addressbook_node_add_group(
        ADDRESS_OBJECT_NAME(adapter) = g_strdup( ADDRITEM_NAME(itemGroup) );
        adapter->itemGroup = itemGroup;
 
        ADDRESS_OBJECT_NAME(adapter) = g_strdup( ADDRITEM_NAME(itemGroup) );
        adapter->itemGroup = itemGroup;
 
-       newNode = gtk_ctree_insert_node( ctree, node, NULL, name, FOLDER_SPACING,
+       newNode = gtk_sctree_insert_node( ctree, node, NULL, name, FOLDER_SPACING,
                        atci->iconXpm, atci->maskXpm, atci->iconXpm, atci->maskXpm,
                        atci->treeLeaf, atci->treeExpand );
        gtk_ctree_node_set_row_data_full( ctree, newNode, adapter,
                        atci->iconXpm, atci->maskXpm, atci->iconXpm, atci->maskXpm,
                        atci->treeLeaf, atci->treeExpand );
        gtk_ctree_node_set_row_data_full( ctree, newNode, adapter,
@@ -3539,7 +3539,7 @@ static GtkCTreeNode *addressbook_node_add_folder(
                adapter->itemFolder = itemFolder;
 
                name = ADDRITEM_NAME(itemFolder);
                adapter->itemFolder = itemFolder;
 
                name = ADDRITEM_NAME(itemFolder);
-               newNode = gtk_ctree_insert_node( ctree, node, NULL, &name, FOLDER_SPACING,
+               newNode = gtk_sctree_insert_node( ctree, node, NULL, &name, FOLDER_SPACING,
                                atci->iconXpm, atci->maskXpm, atci->iconXpm, atci->maskXpm,
                                atci->treeLeaf, atci->treeExpand );
                if( newNode ) {
                                atci->iconXpm, atci->maskXpm, atci->iconXpm, atci->maskXpm,
                                atci->treeLeaf, atci->treeExpand );
                if( newNode ) {
index 38326a09292977716284813a09adb2d3a89d278a..f7b5344a9b2ef66688672a002a24c33d4996856a 100644 (file)
@@ -895,7 +895,7 @@ void folderview_append_item(FolderItem *item)
                                gtk_clist_freeze(GTK_CLIST(ctree));
 
                                text[col_pos[F_COL_FOLDER]] = item->name;
                                gtk_clist_freeze(GTK_CLIST(ctree));
 
                                text[col_pos[F_COL_FOLDER]] = item->name;
-                               child = gtk_ctree_insert_node
+                               child = gtk_sctree_insert_node
                                        (ctree, node, NULL, text,
                                         FOLDER_SPACING,
                                         folderxpm, folderxpmmask,
                                        (ctree, node, NULL, text,
                                         FOLDER_SPACING,
                                         folderxpm, folderxpmmask,
@@ -1388,7 +1388,7 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
            prefs_common.display_folder_unread) {
                str = g_strdup_printf("%s (%d%s)", name, item->total_msgs,
                                      add_unread_mark ? "+" : "");
            prefs_common.display_folder_unread) {
                str = g_strdup_printf("%s (%d%s)", name, item->total_msgs,
                                      add_unread_mark ? "+" : "");
-               gtk_ctree_set_node_info(ctree, node, str, FOLDER_SPACING,
+               gtk_sctree_set_node_info(ctree, node, str, FOLDER_SPACING,
                                        xpm, mask, openxpm, openmask,
                                        FALSE, GTK_CTREE_ROW(node)->expanded);
                g_free(str);
                                        xpm, mask, openxpm, openmask,
                                        FALSE, GTK_CTREE_ROW(node)->expanded);
                g_free(str);
@@ -1402,7 +1402,7 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
                                              item->unreadmarked_msgs > 0 ? "!":"");
                else
                        str = g_strdup_printf("%s (+)", name);
                                              item->unreadmarked_msgs > 0 ? "!":"");
                else
                        str = g_strdup_printf("%s (+)", name);
-               gtk_ctree_set_node_info(ctree, node, str, FOLDER_SPACING,
+               gtk_sctree_set_node_info(ctree, node, str, FOLDER_SPACING,
                                        xpm, mask, openxpm, openmask,
                                        FALSE, GTK_CTREE_ROW(node)->expanded);
                g_free(str);
                                        xpm, mask, openxpm, openmask,
                                        FALSE, GTK_CTREE_ROW(node)->expanded);
                g_free(str);
@@ -1410,7 +1410,7 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
                str = g_strdup_printf("%s%s", name, 
                                      item->unreadmarked_msgs > 0 ? " (!)":"");
        
                str = g_strdup_printf("%s%s", name, 
                                      item->unreadmarked_msgs > 0 ? " (!)":"");
        
-               gtk_ctree_set_node_info(ctree, node, str, FOLDER_SPACING,
+               gtk_sctree_set_node_info(ctree, node, str, FOLDER_SPACING,
                                        xpm, mask, openxpm, openmask,
                                        FALSE, GTK_CTREE_ROW(node)->expanded);
                g_free(str);
                                        xpm, mask, openxpm, openmask,
                                        FALSE, GTK_CTREE_ROW(node)->expanded);
                g_free(str);
@@ -2071,7 +2071,7 @@ void folderview_create_folder_node(FolderView *folderview, FolderItem *item)
        gtk_clist_freeze(GTK_CLIST(ctree));
 
        text[col_pos[F_COL_FOLDER]] = item->name;
        gtk_clist_freeze(GTK_CLIST(ctree));
 
        text[col_pos[F_COL_FOLDER]] = item->name;
-       node = gtk_ctree_insert_node(ctree, parent_node, NULL, text,
+       node = gtk_sctree_insert_node(ctree, parent_node, NULL, text,
                                     FOLDER_SPACING,
                                     folderxpm, folderxpmmask,
                                     folderopenxpm, folderopenxpmmask,
                                     FOLDER_SPACING,
                                     folderxpm, folderxpmmask,
                                     folderopenxpm, folderopenxpmmask,
index b45e6dac4770501cb0d7dc58c1a43ea47111b871..9f6d963a8f49af1e923aa244fbc9a6b8896bb065 100644 (file)
@@ -307,7 +307,7 @@ static GtkCTreeNode *grouplist_create_parent(const gchar *name,
 
        node = parent ? GTK_CTREE_ROW(parent)->children
                : GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
 
        node = parent ? GTK_CTREE_ROW(parent)->children
                : GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
-       node = gtk_ctree_insert_node(GTK_CTREE(ctree), parent, node,
+       node = gtk_sctree_insert_node(GTK_CTREE(ctree), parent, node,
                                     cols, 0, NULL, NULL, NULL, NULL,
                                     FALSE, FALSE);
        if (parent && g_pattern_match_simple(pattern, parent_name) == FALSE)
                                     cols, 0, NULL, NULL, NULL, NULL,
                                     FALSE, FALSE);
        if (parent && g_pattern_match_simple(pattern, parent_name) == FALSE)
@@ -352,14 +352,14 @@ static GtkCTreeNode *grouplist_create_branch(NewsGroupInfo *ginfo,
        parent = grouplist_create_parent(parent_name, pattern);
        node = grouplist_hash_get_branch_node(name);
        if (node) {
        parent = grouplist_create_parent(parent_name, pattern);
        node = grouplist_hash_get_branch_node(name);
        if (node) {
-               gtk_ctree_set_node_info(GTK_CTREE(ctree), node, cols[0], 0,
+               gtk_sctree_set_node_info(GTK_CTREE(ctree), node, cols[0], 0,
                                        NULL, NULL, NULL, NULL, FALSE, FALSE);
                gtk_ctree_node_set_text(GTK_CTREE(ctree), node, 1, cols[1]);
                gtk_ctree_node_set_text(GTK_CTREE(ctree), node, 2, cols[2]);
        } else {
                node = parent ? GTK_CTREE_ROW(parent)->children
                        : GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
                                        NULL, NULL, NULL, NULL, FALSE, FALSE);
                gtk_ctree_node_set_text(GTK_CTREE(ctree), node, 1, cols[1]);
                gtk_ctree_node_set_text(GTK_CTREE(ctree), node, 2, cols[2]);
        } else {
                node = parent ? GTK_CTREE_ROW(parent)->children
                        : GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
-               node = gtk_ctree_insert_node(GTK_CTREE(ctree), parent, node,
+               node = gtk_sctree_insert_node(GTK_CTREE(ctree), parent, node,
                                             cols, 0, NULL, NULL, NULL, NULL,
                                             TRUE, FALSE);
                if (parent &&
                                             cols, 0, NULL, NULL, NULL, NULL,
                                             TRUE, FALSE);
                if (parent &&
index 83ef9d7736ee046aa4a61980c900ef246c653393..218a8c4a48a04712dd296360ac322bed765ed17f 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "gtksctree.h"
 #include "sylpheed-marshal.h"
 
 #include "gtksctree.h"
 #include "sylpheed-marshal.h"
-
+#include "stock_pixmap.h"
 
 enum {
        ROW_POPUP_MENU,
 
 enum {
        ROW_POPUP_MENU,
@@ -16,6 +16,8 @@ enum {
        LAST_SIGNAL
 };
 
        LAST_SIGNAL
 };
 
+static GdkPixmap *emptyxpm = NULL;
+static GdkBitmap *emptyxpmmask = NULL;
 
 static void gtk_sctree_class_init (GtkSCTreeClass *class);
 static void gtk_sctree_init (GtkSCTree *sctree);
 
 static void gtk_sctree_class_init (GtkSCTreeClass *class);
 static void gtk_sctree_init (GtkSCTree *sctree);
@@ -1084,3 +1086,71 @@ gtk_ctree_last_visible (GtkCTree     *ctree,
 
        return gtk_ctree_last_visible (ctree, work);
 }
 
        return gtk_ctree_last_visible (ctree, work);
 }
+
+/* this wrapper simply replaces NULL pixmaps 
+ * with a transparent, 1x1 pixmap. This works
+ * around a memory problem deep inside gtk, 
+ * revealed by valgrind. 
+ */
+GtkCTreeNode* gtk_sctree_insert_node        (GtkCTree *ctree,
+                                             GtkCTreeNode *parent,
+                                             GtkCTreeNode *sibling,
+                                             gchar *text[],
+                                             guint8 spacing,
+                                             GdkPixmap *pixmap_closed,
+                                             GdkBitmap *mask_closed,
+                                             GdkPixmap *pixmap_opened,
+                                             GdkBitmap *mask_opened,
+                                             gboolean is_leaf,
+                                             gboolean expanded)
+{
+       if (!emptyxpm) {
+               stock_pixmap_gdk(ctree, STOCK_PIXMAP_EMPTY,
+                        &emptyxpm, &emptyxpmmask);
+       }
+       if (!pixmap_closed) {
+               pixmap_closed = emptyxpm;
+               mask_closed = emptyxpmmask;
+       }
+       if (!pixmap_opened) {
+               pixmap_opened = emptyxpm;
+               mask_opened = emptyxpmmask;
+       }
+       return gtk_ctree_insert_node(ctree, parent, sibling, text,spacing,
+               pixmap_closed, mask_closed, pixmap_opened, mask_opened,
+               is_leaf, expanded);
+}
+
+/* this wrapper simply replaces NULL pixmaps 
+ * with a transparent, 1x1 pixmap. This works
+ * around a memory problem deep inside gtk, 
+ * revealed by valgrind. 
+ */
+void        gtk_sctree_set_node_info        (GtkCTree *ctree,
+                                             GtkCTreeNode *node,
+                                             const gchar *text,
+                                             guint8 spacing,
+                                             GdkPixmap *pixmap_closed,
+                                             GdkBitmap *mask_closed,
+                                             GdkPixmap *pixmap_opened,
+                                             GdkBitmap *mask_opened,
+                                             gboolean is_leaf,
+                                             gboolean expanded)
+{
+       if (!emptyxpm) {
+               stock_pixmap_gdk(ctree, STOCK_PIXMAP_EMPTY,
+                        &emptyxpm, &emptyxpmmask);
+       }
+       if (!pixmap_closed) {
+               pixmap_closed = emptyxpm;
+               mask_closed = emptyxpmmask;
+       }
+       if (!pixmap_opened) {
+               pixmap_opened = emptyxpm;
+               mask_opened = emptyxpmmask;
+       }
+       gtk_ctree_set_node_info(ctree, node, text, spacing,
+               pixmap_closed, mask_closed, pixmap_opened, mask_opened,
+               is_leaf, expanded);
+
+}
index 7da82a71287f62404736522424ea5bbe6f5286ad..c0228d63ac4b36f4e7af4cd495e811010cfdf785 100644 (file)
@@ -76,4 +76,26 @@ void gtk_sctree_sort_node (GtkCTree *ctree, GtkCTreeNode *node);
 
 void gtk_sctree_sort_recursive (GtkCTree *ctree, GtkCTreeNode *node);
 
 
 void gtk_sctree_sort_recursive (GtkCTree *ctree, GtkCTreeNode *node);
 
+GtkCTreeNode* gtk_sctree_insert_node        (GtkCTree *ctree,
+                                             GtkCTreeNode *parent,
+                                             GtkCTreeNode *sibling,
+                                             gchar *text[],
+                                             guint8 spacing,
+                                             GdkPixmap *pixmap_closed,
+                                             GdkBitmap *mask_closed,
+                                             GdkPixmap *pixmap_opened,
+                                             GdkBitmap *mask_opened,
+                                             gboolean is_leaf,
+                                             gboolean expanded);
+void        gtk_sctree_set_node_info        (GtkCTree *ctree,
+                                             GtkCTreeNode *node,
+                                             const gchar *text,
+                                             guint8 spacing,
+                                             GdkPixmap *pixmap_closed,
+                                             GdkBitmap *mask_closed,
+                                             GdkPixmap *pixmap_opened,
+                                             GdkBitmap *mask_opened,
+                                             gboolean is_leaf,
+                                             gboolean expanded);
+
 #endif /* __GTK_SCTREE_H__ */
 #endif /* __GTK_SCTREE_H__ */
index f2895f311dc1d51df67952ee5b5efbbee1fc33e4..1a9d4e6de447fcfaf74d5a83d3cd51817aabad7c 100644 (file)
@@ -442,7 +442,7 @@ static GtkCTreeNode *mimeview_append_part(MimeView *mimeview,
        else
                str[COL_NAME] = (gchar *) get_part_name(partinfo);
 
        else
                str[COL_NAME] = (gchar *) get_part_name(partinfo);
 
-       node = gtk_ctree_insert_node(ctree, parent, NULL, str, 0,
+       node = gtk_sctree_insert_node(ctree, parent, NULL, str, 0,
                                     NULL, NULL, NULL, NULL,
                                     FALSE, TRUE);
        gtk_ctree_node_set_row_data(ctree, node, partinfo);
                                     NULL, NULL, NULL, NULL,
                                     FALSE, TRUE);
        gtk_ctree_node_set_row_data(ctree, node, partinfo);
diff --git a/src/pixmaps/empty.xpm b/src/pixmaps/empty.xpm
new file mode 100644 (file)
index 0000000..5b59855
--- /dev/null
@@ -0,0 +1,5 @@
+/* XPM */
+static char * empty_xpm[] = {
+"1 1 1 1",
+"      c None",
+" "};
index 559a3eb835ceced53eca802b374f3e18b7affc60..4dfbd81ed5e62c08e03ffade723b883ee0579901 100644 (file)
 #include "pixmaps/drafts_close_mark.xpm"
 #include "pixmaps/drafts_open_mark.xpm"
 #include "pixmaps/dir_noselect.xpm"
 #include "pixmaps/drafts_close_mark.xpm"
 #include "pixmaps/drafts_open_mark.xpm"
 #include "pixmaps/dir_noselect.xpm"
+#include "pixmaps/empty.xpm"
 
 typedef struct _StockPixmapData        StockPixmapData;
 
 
 typedef struct _StockPixmapData        StockPixmapData;
 
@@ -292,7 +293,8 @@ static StockPixmapData pixmaps[] =
        {read_xpm                               , NULL, NULL, "read", NULL},
        {trash_btn_xpm                          , NULL, NULL, "trash_btn", NULL},
        {sylpheed_logo_xpm                      , NULL, NULL, "sylpheed_logo", NULL},
        {read_xpm                               , NULL, NULL, "read", NULL},
        {trash_btn_xpm                          , NULL, NULL, "trash_btn", NULL},
        {sylpheed_logo_xpm                      , NULL, NULL, "sylpheed_logo", NULL},
-        {dir_noselect_xpm                       , NULL, NULL, "dir_noselect" , NULL}
+        {dir_noselect_xpm                       , NULL, NULL, "dir_noselect" , NULL},
+        {empty_xpm                              , NULL, NULL, "empty" , NULL}
 };
 
 /* return newly constructed GtkPixmap from GdkPixmap */
 };
 
 /* return newly constructed GtkPixmap from GdkPixmap */
index 3a4f7742ee1b5864e2016cac698b88fa6d02daec..fe53c25f4e690932b721af2827f853e4032a5015 100644 (file)
@@ -151,8 +151,8 @@ typedef enum
        STOCK_PIXMAP_READ,
        STOCK_PIXMAP_TRASH,
        STOCK_PIXMAP_SYLPHEED_LOGO,
        STOCK_PIXMAP_READ,
        STOCK_PIXMAP_TRASH,
        STOCK_PIXMAP_SYLPHEED_LOGO,
-       STOCK_PIXMAP_DIR_NOSELECT,              /* last entry */
-       
+       STOCK_PIXMAP_DIR_NOSELECT, 
+       STOCK_PIXMAP_EMPTY,              /* last entry */
        N_STOCK_PIXMAPS
 } StockPixmap;
 
        N_STOCK_PIXMAPS
 } StockPixmap;
 
index f92c1fae6f9fd06938a9521e1c580b24f8d62f64..4c7d733a2c6f4caae3d93067b8904418fe106f82 100644 (file)
@@ -2190,7 +2190,7 @@ gboolean summary_insert_gnode_func(GtkCTree *ctree, guint depth, GNode *gnode,
 
        summary_set_header(summaryview, text, msginfo);
 
 
        summary_set_header(summaryview, text, msginfo);
 
-       gtk_ctree_set_node_info(ctree, cnode, text[col_pos[S_COL_SUBJECT]], 2,
+       gtk_sctree_set_node_info(ctree, cnode, text[col_pos[S_COL_SUBJECT]], 2,
                                NULL, NULL, NULL, NULL, FALSE,
                                gnode->parent->parent ? TRUE : FALSE);
 #define SET_TEXT(col) \
                                NULL, NULL, NULL, NULL, FALSE,
                                gnode->parent->parent ? TRUE : FALSE);
 #define SET_TEXT(col) \
@@ -2268,9 +2268,10 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
 
                        summary_set_header(summaryview, text, msginfo);
 
 
                        summary_set_header(summaryview, text, msginfo);
 
-                       node = gtk_ctree_insert_node
+                       node = gtk_sctree_insert_node
                                (ctree, NULL, node, text, 2,
                                (ctree, NULL, node, text, 2,
-                                NULL, NULL, NULL, NULL, FALSE, FALSE);
+                                NULL, NULL, NULL, NULL,
+                                FALSE, FALSE);
                        GTKUT_CTREE_NODE_SET_ROW_DATA(node, msginfo);
                        summary_set_marks_func(ctree, node, summaryview);
 
                        GTKUT_CTREE_NODE_SET_ROW_DATA(node, msginfo);
                        summary_set_marks_func(ctree, node, summaryview);