diff options
Diffstat (limited to 'calendar/gui/comp-util.c')
-rw-r--r-- | calendar/gui/comp-util.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c index df4817d70d..fc3496be67 100644 --- a/calendar/gui/comp-util.c +++ b/calendar/gui/comp-util.c @@ -258,7 +258,7 @@ cal_comp_is_on_server (CalComponent *comp, CalClient *client) * Return value: A newly-created calendar component. **/ CalComponent * -cal_comp_event_new_with_defaults (void) +cal_comp_event_new_with_defaults (CalClient *client) { CalComponent *comp; int interval; @@ -268,10 +268,9 @@ cal_comp_event_new_with_defaults (void) icalproperty *icalprop; CalAlarmTrigger trigger; - comp = cal_component_new (); - - cal_component_set_new_vtype (comp, CAL_COMPONENT_EVENT); - + if (cal_client_get_default_object (client, CALOBJ_TYPE_EVENT, &comp) != CAL_CLIENT_GET_SUCCESS) + return NULL; + if (!calendar_config_get_use_default_reminder ()) return comp; @@ -321,3 +320,14 @@ cal_comp_event_new_with_defaults (void) return comp; } + +CalComponent * +cal_comp_task_new_with_defaults (CalClient *client) +{ + CalComponent *comp; + + if (cal_client_get_default_object (client, CALOBJ_TYPE_TODO, &comp) != CAL_CLIENT_GET_SUCCESS) + return NULL; + + return comp; +} |