aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-group-container.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-02-25 13:53:54 +0800
committerChris Lahey <clahey@src.gnome.org>2000-02-25 13:53:54 +0800
commit323b824b844a937593833c1704b6f2cd5335d6a5 (patch)
tree2b819c8f4d95520645a68d3a4551fa6a4073681a /widgets/table/e-table-group-container.c
parent7f601b6db6eed262aeda3276ee4c4987d2818843 (diff)
downloadgsoc2013-evolution-323b824b844a937593833c1704b6f2cd5335d6a5.tar
gsoc2013-evolution-323b824b844a937593833c1704b6f2cd5335d6a5.tar.gz
gsoc2013-evolution-323b824b844a937593833c1704b6f2cd5335d6a5.tar.bz2
gsoc2013-evolution-323b824b844a937593833c1704b6f2cd5335d6a5.tar.lz
gsoc2013-evolution-323b824b844a937593833c1704b6f2cd5335d6a5.tar.xz
gsoc2013-evolution-323b824b844a937593833c1704b6f2cd5335d6a5.tar.zst
gsoc2013-evolution-323b824b844a937593833c1704b6f2cd5335d6a5.zip
Made the E table item redraw properly.
2000-02-25 Christopher James Lahey <clahey@helixcode.com> * e-table-item.c: Made the E table item redraw properly. * e-table-group-container.c: Added handling to distinguish between n items and 1 item. Got rid of a crash due to an abandoned timeout callback. svn path=/trunk/; revision=1933
Diffstat (limited to 'widgets/table/e-table-group-container.c')
-rw-r--r--widgets/table/e-table-group-container.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c
index 4b30f6af29..1ae73b6c3b 100644
--- a/widgets/table/e-table-group-container.c
+++ b/widgets/table/e-table-group-container.c
@@ -75,6 +75,8 @@ e_table_group_container_list_free(ETableGroupContainer *etgc)
{
ETableGroupContainerChildNode *child_node;
GList *list;
+ if ( etgc->idle )
+ g_source_remove( etgc->idle );
for ( list = etgc->children; list; list = g_list_next(list) ) {
child_node = (ETableGroupContainerChildNode *) list->data;
e_table_group_container_child_node_free(etgc, child_node);
@@ -87,9 +89,16 @@ etgc_destroy (GtkObject *object)
{
ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (object);
- gdk_font_unref(etgc->font);
- gtk_object_unref(GTK_OBJECT(etgc->ecol));
- gtk_object_destroy(GTK_OBJECT(etgc->rect));
+ if ( etgc->font ) {
+ gdk_font_unref(etgc->font);
+ etgc->font = NULL;
+ }
+ if ( etgc->ecol ) {
+ gtk_object_unref(GTK_OBJECT(etgc->ecol));
+ }
+ if ( etgc->rect ) {
+ gtk_object_destroy(GTK_OBJECT(etgc->rect));
+ }
e_table_group_container_list_free(etgc);
GTK_OBJECT_CLASS (etgc_parent_class)->destroy (object);
@@ -502,8 +511,6 @@ etgc_unrealize (GnomeCanvasItem *item)
etgc = E_TABLE_GROUP_CONTAINER (item);
- etgc->font = NULL;
-
if (GNOME_CANVAS_ITEM_CLASS(etgc_parent_class)->unrealize)
(* GNOME_CANVAS_ITEM_CLASS(etgc_parent_class)->unrealize) (item);
}
@@ -512,7 +519,7 @@ static void
compute_text (ETableGroupContainer *etgc, ETableGroupContainerChildNode *child_node)
{
/* FIXME : What a hack, eh? */
- gchar *text = g_strdup_printf("%s : %s (%d items)", etgc->ecol->text, (gchar *)child_node->key, (gint) child_node->count);
+ gchar *text = g_strdup_printf("%s : %s (%d item%s)", etgc->ecol->text, (gchar *)child_node->key, (gint) child_node->count, child_node->count == 1 ? "" : "s" );
gnome_canvas_item_set(child_node->text,
"text", text,
NULL);