diff options
author | JP Rosevear <jpr@helixcode.com> | 2000-08-26 04:46:08 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2000-08-26 04:46:08 +0800 |
commit | 10e6501b5dca0bd5375d5d4f4ece5cdb1bbee9d4 (patch) | |
tree | 72e631f1c354a3b2c94fe927250fcdbbfac8b901 /calendar/gui | |
parent | c1f3e5432aab231b1e565e9a79e065abf622d4a7 (diff) | |
download | gsoc2013-evolution-10e6501b5dca0bd5375d5d4f4ece5cdb1bbee9d4.tar gsoc2013-evolution-10e6501b5dca0bd5375d5d4f4ece5cdb1bbee9d4.tar.gz gsoc2013-evolution-10e6501b5dca0bd5375d5d4f4ece5cdb1bbee9d4.tar.bz2 gsoc2013-evolution-10e6501b5dca0bd5375d5d4f4ece5cdb1bbee9d4.tar.lz gsoc2013-evolution-10e6501b5dca0bd5375d5d4f4ece5cdb1bbee9d4.tar.xz gsoc2013-evolution-10e6501b5dca0bd5375d5d4f4ece5cdb1bbee9d4.tar.zst gsoc2013-evolution-10e6501b5dca0bd5375d5d4f4ece5cdb1bbee9d4.zip |
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
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/calendar-model.c | 9 | ||||
-rw-r--r-- | calendar/gui/e-calendar-table.c | 22 | ||||
-rw-r--r-- | calendar/gui/e-calendar-table.h | 3 |
3 files changed, 17 insertions, 17 deletions
diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c index e9f1a8884b..aac20d2b7c 100644 --- a/calendar/gui/calendar-model.c +++ b/calendar/gui/calendar-model.c @@ -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; diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index 2c5a74efe8..a1b224c424 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -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); diff --git a/calendar/gui/e-calendar-table.h b/calendar/gui/e-calendar-table.h index eed021e846..38e3eafea3 100644 --- a/calendar/gui/e-calendar-table.h +++ b/calendar/gui/e-calendar-table.h @@ -58,7 +58,8 @@ struct _ECalendarTable GtkTable table; CalendarModel *model; - + + /* Colors for drawing. */ GdkColor colors[E_CALENDAR_TABLE_COLOR_LAST]; }; |