Don't attempt to free this if its null (calendar_model_duplicate_value):

2000-08-25  JP Rosevear  <jpr@helixcode.com>

	* gui/calendar-model.c (get_is_complete): Don't attempt to
	free this if its null
	(calendar_model_duplicate_value): Implement for summary field
	value
	(calendar_model_initialize_value): Remove debug code

	* gui/e-calendar-table.c: Correct etable init xml
	(create_column): Pass the id to e_table_header_add_column
	rather than a hard coded one
	(e_calendar_table_init): Make sure summary column isn't
	added twice.  Add an alarms column, else etable won't
	work with columns who have an ID higher than that

svn path=/trunk/; revision=5040
This commit is contained in:
JP Rosevear
2000-08-25 20:46:08 +00:00
committed by JP Rosevear
parent c1f3e5432a
commit 10e6501b5d
4 changed files with 43 additions and 17 deletions

View File

@ -1,3 +1,29 @@
2000-08-25 JP Rosevear <jpr@helixcode.com>
* gui/calendar-model.c (get_is_complete): Don't attempt to
free this if its null
(calendar_model_duplicate_value): Implement for summary field
value
(calendar_model_initialize_value): Remove debug code
* gui/e-calendar-table.c: Correct etable init xml
(create_column): Pass the id to e_table_header_add_column
rather than a hard coded one
(e_calendar_table_init): Make sure summary column isn't
added twice. Add an alarms column, else etable won't
work with columns who have an ID higher than that
2000-08-24 JP Rosevear <jpr@helixcode.com>
* gui/gncal-todo.c (ok_button): Properly append to list
* gui/event-editor.c (dialog_to_comp_object): ditto
* gui/e-day-view.c (e_day_view_on_new_appointment): The base
times are not UTC
* gui/e-week-view.c (e_week_view_on_new_appointment): ditto
2000-08-24 JP Rosevear <jpr@helixcode.com>
* Update for libical 0.19

View File

@ -553,7 +553,9 @@ get_is_complete (CalComponent *comp)
cal_component_get_completed (comp, &t);
retval = (t != NULL);
cal_component_free_icaltimetype (t);
if (retval)
cal_component_free_icaltimetype (t);
return retval;
}
@ -1239,6 +1241,7 @@ calendar_model_duplicate_value (ETableModel *etm, int col, const void *value)
case CAL_COMPONENT_FIELD_GEO:
case CAL_COMPONENT_FIELD_PERCENT:
case CAL_COMPONENT_FIELD_PRIORITY:
case CAL_COMPONENT_FIELD_SUMMARY:
return dup_string (value);
case CAL_COMPONENT_FIELD_TRANSPARENCY:
@ -1331,10 +1334,8 @@ calendar_model_initialize_value (ETableModel *etm, int col)
case CAL_COMPONENT_FIELD_GEO:
case CAL_COMPONENT_FIELD_PERCENT:
case CAL_COMPONENT_FIELD_PRIORITY:
return init_string ();
case CAL_COMPONENT_FIELD_SUMMARY:
return g_strdup ("Hello");
return init_string ();
case CAL_COMPONENT_FIELD_TRANSPARENCY:
return NULL;

View File

@ -136,9 +136,9 @@ e_calendar_table_class_init (ECalendarTableClass *class)
#define E_CALENDAR_TABLE_SPEC \
"<ETableSpecification click-to-add=\"1\">" \
"<columns-shown>" \
"<column> 16 </column>" \
"<column> 17 </column>" \
"<column> 13 </column>" \
"<column> 9 </column>" \
"<column> 14 </column>" \
"</columns-shown>" \
"<grouping> </grouping>" \
"</ETableSpecification>"
@ -152,7 +152,7 @@ create_column (ETableHeader *header, ETableModel *model, int id, const char *tex
cell = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT);
column = e_table_col_new (id, text, 1.0, 10, cell, g_str_compare, TRUE);
e_table_header_add_column (header, column, CAL_COMPONENT_FIELD_CATEGORIES);
e_table_header_add_column (header, column, id);
}
static void
@ -193,7 +193,6 @@ e_calendar_table_init (ECalendarTable *cal_table)
gtk_object_sink (GTK_OBJECT (header));
/* Create the header columns */
create_column (header, model, CAL_COMPONENT_FIELD_CATEGORIES, _("Categories"));
create_column (header, model, CAL_COMPONENT_FIELD_CLASSIFICATION, _("Classification"));
create_column (header, model, CAL_COMPONENT_FIELD_COMPLETED, _("Completion date"));
@ -205,20 +204,19 @@ e_calendar_table_init (ECalendarTable *cal_table)
create_column (header, model, CAL_COMPONENT_FIELD_PRIORITY, _("Priority"));
cell = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT);
gtk_object_set (GTK_OBJECT (cell),
"strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
"bold_column", CAL_COMPONENT_FIELD_OVERDUE,
"color_column", CAL_COMPONENT_FIELD_COLOR,
NULL);
// gtk_object_set (GTK_OBJECT (cell),
// "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE,
// "bold_column", CAL_COMPONENT_FIELD_OVERDUE,
// "color_column", CAL_COMPONENT_FIELD_COLOR,
// NULL);
column = e_table_col_new (CAL_COMPONENT_FIELD_SUMMARY, _("Summary"),
1.0, 10, cell, g_str_compare, TRUE);
e_table_header_add_column (header, column, CAL_COMPONENT_FIELD_SUMMARY);
create_column (header, model, CAL_COMPONENT_FIELD_SUMMARY, _("Summary"));
create_column (header, model, CAL_COMPONENT_FIELD_TRANSPARENCY, _("Transparency"));
create_column (header, model, CAL_COMPONENT_FIELD_URL, _("URL"));
/* FIXME: we don't have the HAS_ALARMS field */
create_column (header, model, CAL_COMPONENT_FIELD_HAS_ALARMS, _("Alarms"));
/* Create pixmaps */
@ -228,7 +226,7 @@ e_calendar_table_init (ECalendarTable *cal_table)
(const char **) icon_xpm_data[i]);
}
cell = e_cell_toggle_new (0, 4, icon_pixbufs);
cell = e_cell_toggle_new (0, E_CALENDAR_MODEL_NUM_ICONS, icon_pixbufs);
column = e_table_col_new_with_pixbuf (CAL_COMPONENT_FIELD_ICON,
icon_pixbufs[0], 0.0, 16, cell,
g_int_compare, FALSE);

View File

@ -58,7 +58,8 @@ struct _ECalendarTable
GtkTable table;
CalendarModel *model;
/* Colors for drawing. */
GdkColor colors[E_CALENDAR_TABLE_COLOR_LAST];
};