From 26c45ab265e8dfec121a765306143de5a579ccbb Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Fri, 19 May 2000 18:47:39 +0000 Subject: Added initialize_value and value_is_empty callbacks. 2000-05-19 Christopher James Lahey * contact-editor/e-contact-editor-categories.c, gui/component/e-addressbook-model.c: Added initialize_value and value_is_empty callbacks. svn path=/trunk/; revision=3139 --- addressbook/gui/widgets/e-addressbook-model.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'addressbook/gui/widgets') diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index b2f7332c52..598f6786cf 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -125,6 +125,18 @@ addressbook_free_value (ETableModel *etc, int col, void *value) g_free(value); } +static void * +addressbook_initialize_value (ETableModel *etc, int col) +{ + return g_strdup(""); +} + +static gboolean +addressbook_value_is_empty (ETableModel *etc, int col, const void *value) +{ + return !(value && *(char *)value); +} + /* This function is for when the model is unfrozen. This can mostly be ignored for simple models. */ static void @@ -201,6 +213,8 @@ e_addressbook_model_class_init (GtkObjectClass *object_class) model_class->is_cell_editable = addressbook_is_cell_editable; model_class->duplicate_value = addressbook_duplicate_value; model_class->free_value = addressbook_free_value; + model_class->initialize_value = addressbook_initialize_value; + model_class->value_is_empty = addressbook_value_is_empty; model_class->thaw = addressbook_thaw; } -- cgit