aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/comp-editor-factory.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/comp-editor-factory.c')
-rw-r--r--calendar/gui/comp-editor-factory.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/calendar/gui/comp-editor-factory.c b/calendar/gui/comp-editor-factory.c
index 12bf83e7dd..44f68c4e83 100644
--- a/calendar/gui/comp-editor-factory.c
+++ b/calendar/gui/comp-editor-factory.c
@@ -26,6 +26,7 @@
#include <cal-client/cal-client.h>
#include "calendar-config.h"
#include "comp-editor-factory.h"
+#include "comp-util.h"
#include "dialogs/event-editor.h"
#include "dialogs/task-editor.h"
@@ -349,13 +350,12 @@ get_default_component (CalComponentVType vtype)
{
CalComponent *comp;
- comp = cal_component_new ();
- cal_component_set_new_vtype (comp, vtype);
-
if (vtype == CAL_COMPONENT_EVENT) {
struct icaltimetype itt;
CalComponentDateTime dt;
+ comp = cal_comp_event_new_with_defaults ();
+
itt = icaltime_today ();
dt.value = &itt;
@@ -365,6 +365,9 @@ get_default_component (CalComponentVType vtype)
cal_component_set_dtend (comp, &dt);
cal_component_commit_sequence (comp);
+ } else {
+ comp = cal_component_new ();
+ cal_component_set_new_vtype (comp, vtype);
}
return comp;