+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
( 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
MICRO_VERSION=15
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=71
+EXTRA_VERSION=72
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
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 = \
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 );
/* 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 );
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,
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);
}
}
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,
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,
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,
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,
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,
/* 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,
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,
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 ) {
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,
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);
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);
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);
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,
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)
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);
- 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 &&
#include "gtksctree.h"
#include "sylpheed-marshal.h"
-
+#include "stock_pixmap.h"
enum {
ROW_POPUP_MENU,
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);
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);
+
+}
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__ */
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);
--- /dev/null
+/* XPM */
+static char * empty_xpm[] = {
+"1 1 1 1",
+" c None",
+" "};
#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;
{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 */
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;
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) \
summary_set_header(summaryview, text, msginfo);
- node = gtk_ctree_insert_node
+ node = gtk_sctree_insert_node
(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);