diff options
-rw-r--r-- | widgets/table/e-cell-date.c | 2 | ||||
-rw-r--r-- | widgets/table/e-tree-memory.c | 17 | ||||
-rw-r--r-- | widgets/table/e-tree-memory.h | 67 |
3 files changed, 52 insertions, 34 deletions
diff --git a/widgets/table/e-cell-date.c b/widgets/table/e-cell-date.c index 00d5ca00aa..c8e2dd5f09 100644 --- a/widgets/table/e-cell-date.c +++ b/widgets/table/e-cell-date.c @@ -34,7 +34,7 @@ ecd_get_text(ECellText *cell, ETableModel *model, int col, int row) localtime_r (&date, &then); localtime_r (&nowdate, &now); - if (nowdate - date < 60 * 60 * 8) { + if (nowdate - date < 60 * 60 * 8 && nowdate > date) { strftime (buf, 26, _("%l:%M %p"), &then); done = TRUE; } diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c index 081716f0f1..e3283f7730 100644 --- a/widgets/table/e-tree-memory.c +++ b/widgets/table/e-tree-memory.c @@ -52,6 +52,8 @@ struct ETreeMemoryPriv { ETreeMemoryPath *root; gboolean expanded_default; /* whether nodes are created expanded or collapsed by default */ gint frozen; + GFunc destroy_func; + gpointer destroy_user_data; }; @@ -325,6 +327,8 @@ e_tree_memory_init (GtkObject *object) priv->root = NULL; priv->frozen = 0; priv->expanded_default = 0; + priv->destroy_func = NULL; + priv->destroy_user_data = NULL; } E_MAKE_TYPE(e_tree_memory, "ETreeMemory", ETreeMemory, e_tree_memory_class_init, e_tree_memory_init, PARENT_TYPE) @@ -507,6 +511,10 @@ child_free(ETreeMemory *etree, ETreeMemoryPath *node) child = next; } + if (etree->priv->destroy_func) { + etree->priv->destroy_func (node->node_data, etree->priv->destroy_user_data); + } + g_chunk_free(node, node_chunk); } @@ -625,3 +633,12 @@ e_tree_memory_sort_node (ETreeMemory *etmm, e_tree_model_node_changed(E_TREE_MODEL(etmm), node); } + +void +e_tree_memory_set_node_destroy_func (ETreeMemory *etmm, + GFunc destroy_func, + gpointer user_data) +{ + etmm->priv->destroy_func = destroy_func; + etmm->priv->destroy_user_data = user_data; +} diff --git a/widgets/table/e-tree-memory.h b/widgets/table/e-tree-memory.h index 633594c2d5..c14940b6ac 100644 --- a/widgets/table/e-tree-memory.h +++ b/widgets/table/e-tree-memory.h @@ -32,43 +32,44 @@ struct ETreeMemoryClass { }; -GtkType e_tree_memory_get_type (void); -void e_tree_memory_construct (ETreeMemory *etree); -ETreeMemory *e_tree_memory_new (void); +GtkType e_tree_memory_get_type (void); +void e_tree_memory_construct (ETreeMemory *etree); +ETreeMemory *e_tree_memory_new (void); /* node operations */ -ETreePath e_tree_memory_node_insert (ETreeMemory *etree, - ETreePath parent, - int position, - gpointer node_data); -ETreePath e_tree_memory_node_insert_id (ETreeMemory *etree, - ETreePath parent, - int position, - gpointer node_data, - char *id); -ETreePath e_tree_memory_node_insert_before (ETreeMemory *etree, - ETreePath parent, - ETreePath sibling, - gpointer node_data); -gpointer e_tree_memory_node_remove (ETreeMemory *etree, - ETreePath path); +ETreePath e_tree_memory_node_insert (ETreeMemory *etree, + ETreePath parent, + int position, + gpointer node_data); +ETreePath e_tree_memory_node_insert_id (ETreeMemory *etree, + ETreePath parent, + int position, + gpointer node_data, + char *id); +ETreePath e_tree_memory_node_insert_before (ETreeMemory *etree, + ETreePath parent, + ETreePath sibling, + gpointer node_data); +gpointer e_tree_memory_node_remove (ETreeMemory *etree, + ETreePath path); /* Freeze and thaw */ -void e_tree_memory_freeze (ETreeMemory *etree); -void e_tree_memory_thaw (ETreeMemory *etree); - - -void e_tree_memory_set_expanded_default (ETreeMemory *etree, - gboolean expanded); -gpointer e_tree_memory_node_get_data (ETreeMemory *etm, - ETreePath node); -void e_tree_memory_node_set_data (ETreeMemory *etm, - ETreePath node, - gpointer node_data); -void e_tree_memory_sort_node (ETreeMemory *etm, - ETreePath node, - ETreeMemorySortCallback callback, - gpointer user_data); +void e_tree_memory_freeze (ETreeMemory *etree); +void e_tree_memory_thaw (ETreeMemory *etree); +void e_tree_memory_set_expanded_default (ETreeMemory *etree, + gboolean expanded); +gpointer e_tree_memory_node_get_data (ETreeMemory *etm, + ETreePath node); +void e_tree_memory_node_set_data (ETreeMemory *etm, + ETreePath node, + gpointer node_data); +void e_tree_memory_sort_node (ETreeMemory *etm, + ETreePath node, + ETreeMemorySortCallback callback, + gpointer user_data); +void e_tree_memory_set_node_destroy_func (ETreeMemory *etmm, + GFunc destroy_func, + gpointer user_data); #ifdef __cplusplus } |