aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-model.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2001-08-02 11:40:17 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2001-08-02 11:40:17 +0800
commitef025c689be33a54883b5e8b77e58916d1c8002d (patch)
tree8abbb29457c28208bfa599c444bcb82b92fafba7 /calendar/gui/calendar-model.c
parent342880e798defc90709e5e7cf97f89be71eab188 (diff)
downloadgsoc2013-evolution-ef025c689be33a54883b5e8b77e58916d1c8002d.tar
gsoc2013-evolution-ef025c689be33a54883b5e8b77e58916d1c8002d.tar.gz
gsoc2013-evolution-ef025c689be33a54883b5e8b77e58916d1c8002d.tar.bz2
gsoc2013-evolution-ef025c689be33a54883b5e8b77e58916d1c8002d.tar.lz
gsoc2013-evolution-ef025c689be33a54883b5e8b77e58916d1c8002d.tar.xz
gsoc2013-evolution-ef025c689be33a54883b5e8b77e58916d1c8002d.tar.zst
gsoc2013-evolution-ef025c689be33a54883b5e8b77e58916d1c8002d.zip
If the default category is the same as the value passed in to this
2001-08-01 Federico Mena Quintero <federico@ximian.com> * gui/calendar-model.c (calendar_model_value_is_empty): If the default category is the same as the value passed in to this function, return TRUE. This could be a hack or not, but it prevents two items from being added to the table if a category is selected. * gui/e-tasks.c (setup_widgets): Allow the search bar to shrink horizontally. * gui/dialogs/task-page.c (clear_widgets): Pass valid values to e_dialog_option_menu_set(); these need to come from the status map. svn path=/trunk/; revision=11565
Diffstat (limited to 'calendar/gui/calendar-model.c')
-rw-r--r--calendar/gui/calendar-model.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c
index b41c0d2519..94221fdd61 100644
--- a/calendar/gui/calendar-model.c
+++ b/calendar/gui/calendar-model.c
@@ -1612,10 +1612,27 @@ calendar_model_initialize_value (ETableModel *etm, int col)
static gboolean
calendar_model_value_is_empty (ETableModel *etm, int col, const void *value)
{
+ CalendarModel *model;
+ CalendarModelPrivate *priv;
+
g_return_val_if_fail (col >= 0 && col < CAL_COMPONENT_FIELD_NUM_FIELDS, TRUE);
+ model = CALENDAR_MODEL (etm);
+ priv = model->priv;
+
switch (col) {
case CAL_COMPONENT_FIELD_CATEGORIES:
+ /* This could be a hack or not. If the categories field only
+ * contains the default category, then it possibly means that
+ * the user has not entered anything at all in the click-to-add;
+ * the category is in the value because we put it there in
+ * calendar_model_initialize_value().
+ */
+ if (priv->default_category && value && strcmp (priv->default_category, value) == 0)
+ return TRUE;
+ else
+ return string_is_empty (value);
+
case CAL_COMPONENT_FIELD_CLASSIFICATION: /* actually goes here, not by itself */
case CAL_COMPONENT_FIELD_COMPLETED:
case CAL_COMPONENT_FIELD_DTEND: