aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/contact-editor/e-contact-editor-categories.c
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/contact-editor/e-contact-editor-categories.c')
-rw-r--r--addressbook/contact-editor/e-contact-editor-categories.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/addressbook/contact-editor/e-contact-editor-categories.c b/addressbook/contact-editor/e-contact-editor-categories.c
index 3287672861..831fbce2b9 100644
--- a/addressbook/contact-editor/e-contact-editor-categories.c
+++ b/addressbook/contact-editor/e-contact-editor-categories.c
@@ -40,6 +40,8 @@ static void e_contact_editor_categories_set_value_at (ETableModel *etc, int col,
static gboolean e_contact_editor_categories_is_cell_editable (ETableModel *etc, int col, int row, gpointer data);
static void *e_contact_editor_categories_duplicate_value (ETableModel *etc, int col, const void *value, gpointer data);
static void e_contact_editor_categories_free_value (ETableModel *etc, int col, void *value, gpointer data);
+static void *e_contact_editor_categories_initialize_value (ETableModel *etc, int col, gpointer data);
+static gboolean e_contact_editor_categories_value_is_empty (ETableModel *etc, int col, const void *value, gpointer data);
static void e_contact_editor_categories_thaw (ETableModel *etc, gpointer data);
static GnomeDialogClass *parent_class = NULL;
@@ -271,6 +273,8 @@ e_contact_editor_categories_init (EContactEditorCategories *categories)
e_contact_editor_categories_is_cell_editable,
e_contact_editor_categories_duplicate_value,
e_contact_editor_categories_free_value,
+ e_contact_editor_categories_initialize_value,
+ e_contact_editor_categories_value_is_empty,
e_contact_editor_categories_thaw,
categories);
@@ -435,6 +439,24 @@ e_contact_editor_categories_free_value (ETableModel *etc, int col, void *value,
g_free(value);
}
+static void *
+e_contact_editor_categories_initialize_value (ETableModel *etc, int col, gpointer data)
+{
+ if (col == 0)
+ return NULL;
+ else
+ return g_strdup("");
+}
+
+static gboolean
+e_contact_editor_categories_value_is_empty (ETableModel *etc, int col, const void *value, gpointer data)
+{
+ if (col == 0)
+ return value == NULL;
+ else
+ return !(value && *(char *)value);
+}
+
/* This function is for when the model is unfrozen. This can mostly
be ignored for simple models. */
static void